Skip to content

feat(workflow): MDL workflow support - CREATE/DROP/DESCRIBE + BSON round-trip#20

Open
engalar wants to merge 5 commits intomendixlabs:mainfrom
engalar:pr/workflow
Open

feat(workflow): MDL workflow support - CREATE/DROP/DESCRIBE + BSON round-trip#20
engalar wants to merge 5 commits intomendixlabs:mainfrom
engalar:pr/workflow

Conversation

@engalar
Copy link

@engalar engalar commented Mar 21, 2026

Summary

  • Grammar: Add MDL syntax for CREATE/DROP/DESCRIBE WORKFLOW, GRANT/REVOKE EXECUTE ON WORKFLOW, CALCULATED BY attribute, and ENTITY clause for CREATE DEMO USER
  • SDK: Add BSON serialization/deserialization for all workflow activity types; fix UnknownElement to use bson.D for ordering-preserving round-trips; fix LoopSource interface handling in microflow writer
  • Executor: Implement SHOW/DESCRIBE/CREATE/DROP WORKFLOW and workflow security commands; add calculated attribute and demo user entity support; extend catalog with workflow entries
  • Tests: BSON parse/write unit tests with BSON fixtures; MDL round-trip test (CREATE → DESCRIBE comparison)
  • Docs: Update MDL_QUICK_REFERENCE.md, MDL_FEATURE_MATRIX.md, language reference, and skill files

Workflow Activity Types Supported

USER TASK, CALL MICROFLOW (with WITH parameter mappings), CALL WORKFLOW, DECISION, PARALLEL SPLIT, JUMP TO, WAIT FOR TIMER, WAIT FOR NOTIFICATION, ANNOTATION, END

Boundary events: ON ERROR, ON TIMEOUT

Test Plan

  • make test passes (all 7 test packages green)
  • SHOW WORKFLOWS lists workflows in a project with existing workflows
  • DESCRIBE WORKFLOW Module.Name produces valid MDL output
  • CREATE WORKFLOW ... BEGIN ... END WORKFLOW writes to MPR without CE errors (mx check)
  • DROP WORKFLOW Module.Name removes workflow from MPR
  • GRANT/REVOKE EXECUTE ON WORKFLOW updates access rules
  • Workflow BSON round-trip: parse existing workflow → write back → mx check clean

engalar added 5 commits March 21, 2026 23:02
…ulated attributes

- Add CREATE/DROP/DESCRIBE WORKFLOW grammar with all activity types:
  USER TASK, CALL MICROFLOW, CALL WORKFLOW, DECISION, PARALLEL SPLIT,
  JUMP TO, WAIT FOR TIMER, WAIT FOR NOTIFICATION, ANNOTATION, END
- Add GRANT/REVOKE EXECUTE ON WORKFLOW security grammar
- Add CALCULATED BY <microflow> attribute syntax
- Add ENTITY clause for CREATE DEMO USER
- Regenerate ANTLR4 parser (MDLLexer.interp, mdl_parser.go, etc.)
…with RawDoc

- Add writer_workflow.go: serialize all workflow activity types to BSON
- Add parser_workflow.go: parse all workflow $Types with table-driven registry
- Add parser_unknown.go: UnknownElement fallback using bson.D (preserves ordering)
- Fix UnknownElement.RawDoc field type (bson.D instead of map[string]any)
  for round-trip fidelity
- Fix writer_microflow.go: handle LoopSource as interface (IterableList/WhileLoopCondition)
- Add CALCULATED attribute support in domain model writer
…mo user entity

- Add SHOW/DESCRIBE WORKFLOW with full MDL-formatted output
- Add CREATE/DROP WORKFLOW executing AST against BSON writer
- Add GRANT/REVOKE EXECUTE ON WORKFLOW for security access control
- Add CALCULATED BY <microflow> support in CREATE/ALTER ENTITY
- Add ENTITY clause support in CREATE DEMO USER
- Add workflow entries to catalog (builder_modules, builder_strings)
- Extend LSP completions for workflow keywords
- Update help topics (entity, security, workflow)
- Fix DESCRIBE WORKFLOW round-trip: USER TASK due date, boundary events,
  multi-user task, CALL MICROFLOW WITH parameter mappings
- Add workflow_parse_test.go: parse WorkflowBaseline BSON fixtures
- Add workflow_write_test.go: write workflow BSON and verify structure
- Add BSON fixtures: WorkflowBaseline.Workflow.bson, Sub_Workflow.bson
- Add visitor_workflow_test.go: test all workflow activity AST visitors
- Add roundtrip_workflow_test.go: CREATE WORKFLOW → DESCRIBE WORKFLOW comparison
- Fix expected values: TRUE/FALSE capitalization, RETURNS keyword
…urity

- MDL_QUICK_REFERENCE.md: add Workflows section with all activity types
- MDL_FEATURE_MATRIX.md: mark workflow SHOW/DESCRIBE/CREATE/DROP/GRANT/REVOKE
- docs/language-reference.md: add CALCULATED attribute syntax
- Skills: docker-workflow (empty project, port conflicts, runtime copying)
- Skills: generate-domain-model (CALCULATED attribute docs)
- Skills: manage-security (ENTITY clause for CREATE DEMO USER)
- CLAUDE.md: update project status for implemented features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant