Skip to content

Commit b1d7ea0

Browse files
engalarclaude
authored andcommitted
fix: generate VoidConditionOutcome before parameter binding check (CE6686)
autoBindCallMicroflow() generated the default VoidConditionOutcome inside the microflow lookup loop, after the early return for explicit parameter mappings. When MDL included WITH (...) clauses, the function returned before reaching outcome generation, producing CallMicroflowTask activities with empty Outcomes — triggering CE6686 in Studio Pro. Move outcome generation before the parameter check so it runs unconditionally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3ca3e85 commit b1d7ea0

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

mdl/executor/cmd_workflows_write.go

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -675,11 +675,25 @@ func autoBindActivitiesInFlow(ctx *ExecContext, activities []workflows.WorkflowA
675675
}
676676

677677
// autoBindCallMicroflow resolves microflow parameters and auto-generates ParameterMappings.
678+
// Also ensures a default VoidConditionOutcome exists (required by Mendix runtime — CE6686).
678679
func autoBindCallMicroflow(ctx *ExecContext, task *workflows.CallMicroflowTask) {
679680
// Sanitize name
680681
task.Name = sanitizeActivityName(task.Name)
681682

682-
// Skip if already has parameter mappings
683+
// Auto-generate Default outcome if no outcomes specified.
684+
// This must run regardless of whether parameter mappings exist,
685+
// because the Mendix runtime requires a VoidConditionOutcome on
686+
// every CallMicroflowTask (CE6686: "outcomes do not match").
687+
if len(task.Outcomes) == 0 {
688+
outcome := &workflows.VoidConditionOutcome{
689+
Flow: &workflows.Flow{},
690+
}
691+
outcome.BaseElement.ID = model.ID(types.GenerateID())
692+
outcome.Flow.BaseElement.ID = model.ID(types.GenerateID())
693+
task.Outcomes = append(task.Outcomes, outcome)
694+
}
695+
696+
// Skip parameter auto-binding if already has explicit mappings
683697
if len(task.ParameterMappings) > 0 {
684698
return
685699
}
@@ -713,16 +727,6 @@ func autoBindCallMicroflow(ctx *ExecContext, task *workflows.CallMicroflowTask)
713727
mapping.BaseElement.ID = model.ID(types.GenerateID())
714728
task.ParameterMappings = append(task.ParameterMappings, mapping)
715729
}
716-
717-
// Auto-generate Default outcome if no outcomes specified
718-
if len(task.Outcomes) == 0 {
719-
outcome := &workflows.VoidConditionOutcome{
720-
Flow: &workflows.Flow{},
721-
}
722-
outcome.BaseElement.ID = model.ID(types.GenerateID())
723-
outcome.Flow.BaseElement.ID = model.ID(types.GenerateID())
724-
task.Outcomes = append(task.Outcomes, outcome)
725-
}
726730
break
727731
}
728732
}

0 commit comments

Comments
 (0)