feat: workflow microflow actions and COMPLETE_TASK page action#159
feat: workflow microflow actions and COMPLETE_TASK page action#159ako merged 1 commit intomendixlabs:mainfrom
Conversation
Implement full MDL support for 11 workflow microflow action types (mendixlabs#156, mendixlabs#136) and COMPLETE_TASK button action for workflow task pages (mendixlabs#155). Workflow microflow actions (read + write): - GetWorkflowDataAction: $Data = GET WORKFLOW DATA $Wf AS Module.WF - WorkflowCallAction: $Wf = CALL WORKFLOW Module.WF ($Context) - GetWorkflowsAction: $Wfs = GET WORKFLOWS FOR $Obj - GetWorkflowActivityRecordsAction - WorkflowOperationAction (ABORT/CONTINUE/PAUSE/RESTART/RETRY/UNPAUSE) - SetTaskOutcomeAction: SET TASK OUTCOME $Task 'OutcomeName' - OpenUserTaskAction, NotifyWorkflowAction, OpenWorkflowAction - LockWorkflowAction, UnlockWorkflowAction Page action: - COMPLETE_TASK 'OutcomeName' for ACTIONBUTTON Action: property Closes mendixlabs#156, closes mendixlabs#136, closes mendixlabs#155
ako
left a comment
There was a problem hiding this comment.
Review
Well-structured full-stack implementation — 11 workflow action types + COMPLETE_TASK, each wired through all 8 pipeline layers. ~1,500 lines of real code.
What's good
- Complete pipeline for every action: SDK types, parser, writer, formatter, grammar, AST, visitor, executor
- Grammar design is clean — natural English consistent with existing MDL patterns
- Polymorphic dispatch for
WorkflowOperationActioncorrectly handles 6 operation types - DESCRIBE formatter output matches grammar syntax (re-parseable)
- MDL examples cover all actions
Concerns
DATA and OPEN tokens could conflict with identifiers. These are common words that could appear as entity/attribute names in real projects. CREATE ENTITY Mod.Data (...) or an attribute named Data would break. Can DATA be restricted to the getWorkflowDataStatement context only, or made a soft keyword?
No unit tests for the new code. The test plan only lists mxcli check (syntax parsing) and no-regression. There are no unit tests for the 11 new parser functions, writer functions, or formatter functions. A roundtrip test for at least one action type would add confidence, especially since the BSON field names haven't been verified against a live MPR yet (per test plan).
Minor
COMPLETE_TASKas a single underscore-joined lexer token is unusual but avoids ambiguity. Acceptable.
Summary
-- Unknown actionin DESCRIBECOMPLETE_TASK 'OutcomeName'as a new ACTIONBUTTON action type for workflow task pagesWorkflow Microflow Actions
$Data = GET WORKFLOW DATA $Wf AS Module.Workflow$Wf = CALL WORKFLOW Module.WF ($Context)$Wfs = GET WORKFLOWS FOR $Obj$Records = GET WORKFLOW ACTIVITY RECORDS $WfWORKFLOW OPERATION ABORT/PAUSE/CONTINUE/RESTART/RETRY/UNPAUSE $WfSET TASK OUTCOME $Task 'OutcomeName'OPEN USER TASK $TaskNOTIFY WORKFLOW $WfOPEN WORKFLOW $WfLOCK WORKFLOW $Wf/LOCK WORKFLOW ALLUNLOCK WORKFLOW $Wf/UNLOCK WORKFLOW ALLCOMPLETE_TASK Page Action
Implementation
Full pipeline for each action type:
sdk/microflows/microflows_actions.go)sdk/mpr/parser_microflow_workflow.go)sdk/mpr/writer_microflow_workflow.go)cmd_microflows_format_action.go)MDLLexer.g4,MDLParser.g4)mdl/ast/ast_microflow_workflow.go)mdl/visitor/visitor_microflow_workflow.go)cmd_microflows_builder_workflow.go)Test plan
make buildpassesmake test— all existing tests pass (no regression)mxcli check workflow-microflow-actions.mdl— syntax OKmxcli check complete-task-action.mdl— syntax OK03-page-examples.mdl) still passes with new DATA tokenmxcli execagainst a real project and open in Studio Pro