Skip to content

feat: workflow microflow actions and COMPLETE_TASK page action#159

Merged
ako merged 1 commit intomendixlabs:mainfrom
engalar:feat/workflow-microflow-actions
Apr 9, 2026
Merged

feat: workflow microflow actions and COMPLETE_TASK page action#159
ako merged 1 commit intomendixlabs:mainfrom
engalar:feat/workflow-microflow-actions

Conversation

@engalar
Copy link
Copy Markdown
Contributor

@engalar engalar commented Apr 9, 2026

Summary

Workflow Microflow Actions

Action MDL Syntax
GetWorkflowDataAction $Data = GET WORKFLOW DATA $Wf AS Module.Workflow
WorkflowCallAction $Wf = CALL WORKFLOW Module.WF ($Context)
GetWorkflowsAction $Wfs = GET WORKFLOWS FOR $Obj
GetWorkflowActivityRecordsAction $Records = GET WORKFLOW ACTIVITY RECORDS $Wf
WorkflowOperationAction WORKFLOW OPERATION ABORT/PAUSE/CONTINUE/RESTART/RETRY/UNPAUSE $Wf
SetTaskOutcomeAction SET TASK OUTCOME $Task 'OutcomeName'
OpenUserTaskAction OPEN USER TASK $Task
NotifyWorkflowAction NOTIFY WORKFLOW $Wf
OpenWorkflowAction OPEN WORKFLOW $Wf
LockWorkflowAction LOCK WORKFLOW $Wf / LOCK WORKFLOW ALL
UnlockWorkflowAction UNLOCK WORKFLOW $Wf / UNLOCK WORKFLOW ALL

COMPLETE_TASK Page Action

ACTIONBUTTON btnApprove (
  Caption: 'Approve',
  Action: COMPLETE_TASK 'Approve',
  ButtonStyle: Success
)

Implementation

Full pipeline for each action type:

  • SDK types (sdk/microflows/microflows_actions.go)
  • BSON parser (sdk/mpr/parser_microflow_workflow.go)
  • BSON writer (sdk/mpr/writer_microflow_workflow.go)
  • MDL formatter for DESCRIBE (cmd_microflows_format_action.go)
  • ANTLR4 grammar rules (MDLLexer.g4, MDLParser.g4)
  • AST nodes (mdl/ast/ast_microflow_workflow.go)
  • Visitor (mdl/visitor/visitor_microflow_workflow.go)
  • Executor/builder (cmd_microflows_builder_workflow.go)

Test plan

  • make build passes
  • make test — all existing tests pass (no regression)
  • mxcli check workflow-microflow-actions.mdl — syntax OK
  • mxcli check complete-task-action.mdl — syntax OK
  • Existing page test (03-page-examples.mdl) still passes with new DATA token
  • Test with real MPR containing workflow microflows to verify DESCRIBE output
  • Test CREATE with mxcli exec against a real project and open in Studio Pro

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
Copy link
Copy Markdown
Collaborator

@ako ako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WorkflowOperationAction correctly 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_TASK as a single underscore-joined lexer token is unusual but avoids ambiguity. Acceptable.

@ako ako merged commit 3b022f5 into mendixlabs:main Apr 9, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants