Skip to content

Enum split doctype test skipped from CI because authored MDL fails mx check #462

@hjotha

Description

@hjotha

Source

Follow-up from ako's review on merged PR #364 (feat: support enum split microflow statements).

Problem

`mdl-examples/doctype-tests/enum_split_statement.test.mdl` uses the `.test.mdl` suffix, which `TestMxCheck_DoctypeScripts` (in `mdl/executor/roundtrip_doctype_test.go`) skips. That means CI never runs `mx check` against this fixture.

Renaming to `.mdl` surfaces two real Studio Pro validation errors that authored enum-split MDL currently produces:

```
[error] [CE0079] "The '(empty)' condition value should be configured in properties for an outgoing sequence flow."
at Decision '$Status'
[error] [CE0773] "Value must be of type Enumeration EnumSplitExample.Status."
at Sequence flow
```

The script is:

```mdl
split enum $Status
case Open, Pending
return true;
case Closed
return false;
else
return false;
end split;
```

CE0079 means the split's outgoing flows don't carry the `(empty)` case explicitly. CE0773 means one outgoing flow's `CaseValue` isn't typed as the enum. Both point at the builder emitting the wrong BSON shape for the default branch.

Expected behavior

The described-then-executed enum split passes `mx check` with zero errors, and the doctype fixture can be renamed to `.mdl` so CI catches regressions.

Proposed fix

  1. Builder: set the `else` branch's `CaseValue` to an empty `EnumerationCase` marker (matching Studio Pro), not just an unset value.
  2. Validator: confirm the default branch exists when at least one case is explicit.
  3. Rename `enum_split_statement.test.mdl` → `enum_split_statement.mdl` once the build produces a valid MPR, so `TestMxCheck_DoctypeScripts` exercises it.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions