Skip to content

feat(workflow): add BSON writer support for legacy SystemTask (backward compatibility) #11

@engalar

Description

@engalar

Summary

The BSON parser recognizes Workflows$SystemTask (the legacy activity type name for CallMicroflowTask) for backward compatibility with older Mendix projects. However, there is no BSON writer path for it — the executor always generates Workflows$CallMicroflowTask. If a workflow is read from an old project (containing SystemTask), modified, and written back, the activity type is silently upgraded. This may cause confusion when diffing or version-controlling MPR files.

Gap

Layer Status
BSON Parser ✅ Recognizes Workflows$SystemTask
BSON Writer ❌ Always emits Workflows$CallMicroflowTask
MDL Grammar ❌ No explicit SYSTEM TASK syntax (by design)
Round-trip fidelity ⚠️ Type name silently upgraded on write

Key Files & Lines

BSON Parser — where the type is recognized

  • sdk/mpr/parser_workflow.go:219"Workflows$SystemTask" mapped to parseSystemTask(r)
  • sdk/mpr/parser_workflow.go:313-315parseSystemTask() returns *workflows.SystemTask

SDK Type — where SystemTask is defined

  • Search sdk/ for SystemTask struct — check if it has a flag to preserve original type name

BSON Writer — where to add the legacy path

  • sdk/mpr/writer_workflow.go — search for CallMicroflowTask serialization; add a branch when original type is SystemTask

Options

  1. Preserve on round-trip (recommended for backward compat): track the original $Type in the struct and emit it unchanged on write
  2. Always upgrade (current behavior): accept the silent upgrade — simpler, but changes the BSON on every round-trip
  3. Document as intentional: add a comment in parseSystemTask explaining this is a deliberate upgrade

Notes

  • Workflows$SystemTask was the type name used in Mendix < 10.x before it was renamed to CallMicroflowTask
  • Projects opened and re-saved in Studio Pro perform the same upgrade, so option 2 may be acceptable
  • This issue has low priority unless users report unexpected diffs in version-controlled MPR v2 projects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions