processmaker icon indicating copy to clipboard operation
processmaker copied to clipboard

FOUR-27709: ABE does not work correctly when a parallel gateway is part of the flow

Open eiresendez opened this issue 2 months ago • 1 comments

Issue & Reproduction Steps.

When a process includes a parallel gateway that launches two “Actions By Email” call activities, the flow continues as soon as one email reply is received. Because the package fired a broadcast abe_processed message, both call activities were closed at once—so the parent request proceeded to the final Form Task even though one ABE remained unanswered. Repro: Run the provided BPMN (parallel gateway → two ABE call activities → converging gateway). Start a case and reply to only one of the two ABE emails. The second branch closes automatically and the flow reaches the final Form Task.

Solution

  • Made CallActivity::completeSubprocess() merge only the fields actually updated by the subprocess to avoid overwriting sibling data.
  • Prevented CompleteActivity from re‑merging data for call activities (that merge already happens inside CallActivity).
  • Added targeted delivery in ThrowMessageEvent + Nayra’s EventDefinitionBus so abe_processed messages wake only the intended abe_task_node. Parallel call activities now wait for their own replies.
1 2 3 4

How to Test

  1. Run the ABE process with the parallel gateway (same BPMN provided in the issue).
  2. Start a case, reply to only the first ABE email. Confirm:
  • Only the corresponding call activity shows result = "yes" in the subprocess data.
  • The second branch remains waiting (case stays at the converging gateway).
  • Reply to the second email; verify the flow advances to the final Form Task and both result/result1 are saved in the parent request.

Related Tickets & Packages


[!NOTE] Limits subprocess data merging to updated fields, avoids double-merge for call activities, and targets message events to specific catch events/instances.

  • Call Activity data handling:
    • In ProcessMaker/Models/CallActivity::completeSubprocess, merge back only updated fields from the subprocess data store (using getUpdated when available), falling back to legacy copy-all if not tracked.
  • Activity completion:
    • In ProcessMaker/Jobs/CompleteActivity, skip DataManager->updateData when the element is a CallActivityInterface to prevent duplicate merging.
  • Message event targeting:
    • In ProcessMaker/Jobs/ThrowMessageEvent, add target_catch_event_id and target_instance_id to the message event definition and dispatch after applying payload to the instance datastore.

Written by Cursor Bugbot for commit 725ffe42b79764f141c62c9c02c3439b32bfb554. This will update automatically on new commits. Configure here.

eiresendez avatar Nov 12 '25 00:11 eiresendez

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube