Describe the bug
In a process with two sequential action-setting user tasks (e.g. a submit task followed by an approve task), clicking Approve on the second task routes the workflow down the reject branch. The approve gateway ${action == 'approve'} evaluates false even though the user clicked Approve, so the record ends REJECTED and the approve-branch service tasks (status → APPROVED, the consume/rollup/posting delegates) never run. When both buttons are affected, the approver can never approve at all.
Root cause is two cooperating bugs in generated task-form code:
- The Harmonia task form preloads all process variables into the form model, including the BPMN control variable action (template-form-builder-harmonia/.../ui/form.js.template:130). The earlier submit task set action='submit', so the approve task's form opens with model.action === 'submit'.
- The completion handler spreads the model after the button's action (engine-intent .../generator/form/FormIntentGenerator.java:252, data: Object.assign({ action: action }, $scope.model || {})), so the stale model.action ('submit') overwrites the button's action ('approve'). The task completes with action='submit' → the approve gateway takes its default (reject) flow.
It only bites processes whose approval task is preceded by another action-setting user task; where the approve task is the first/only action task, model.action is undefined and the button value survives.
To Reproduce
- Publish a process with two sequential action-setting user tasks: submit (action submit) → capacity gate → approve (actions approve/reject) → approveDecision ${action == 'approve'} → activate(APPROVED)+consume, else reject.
- Create a vacation request and complete the submit task (sets action='submit').
- As the manager, open the approve task and click Approve.
- Observe the request becomes REJECTED: no VacationDay rows are created and VacationEntitlement.consumedDays never updates — the approve-branch service tasks never ran.
Expected behavior
Clicking Approve must complete the task with action='approve', so the approve gateway evaluates true and the approve-branch chain runs (status → APPROVED, plus the consume/rollup/posting delegates); Reject must complete with action='reject'. The button the user clicked must always determine the completion action — a stale action left over from an earlier task must never override it.
Describe the bug
In a process with two sequential action-setting user tasks (e.g. a submit task followed by an approve task), clicking Approve on the second task routes the workflow down the reject branch. The approve gateway ${action == 'approve'} evaluates false even though the user clicked Approve, so the record ends REJECTED and the approve-branch service tasks (status → APPROVED, the consume/rollup/posting delegates) never run. When both buttons are affected, the approver can never approve at all.
Root cause is two cooperating bugs in generated task-form code:
It only bites processes whose approval task is preceded by another action-setting user task; where the approve task is the first/only action task, model.action is undefined and the button value survives.
To Reproduce
Expected behavior
Clicking Approve must complete the task with action='approve', so the approve gateway evaluates true and the approve-branch chain runs (status → APPROVED, plus the consume/rollup/posting delegates); Reject must complete with action='reject'. The button the user clicked must always determine the completion action — a stale action left over from an earlier task must never override it.