Fix task handlers for multiple process instances with same user task IDs#279
Merged
nitram509 merged 4 commits intonitram509:mainfrom Aug 24, 2025
Merged
Fix task handlers for multiple process instances with same user task IDs#279nitram509 merged 4 commits intonitram509:mainfrom
nitram509 merged 4 commits intonitram509:mainfrom
Conversation
Owner
|
Excellent catch, thank you @erinoggz for fixing this. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #279 +/- ##
=======================================
Coverage 63.81% 63.81%
=======================================
Files 28 28
Lines 1915 1915
=======================================
Hits 1222 1222
Misses 647 647
Partials 46 46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation/Abstract
This is a bug fix for multiple process instances with identical task IDs where only the first created instance could complete its tasks while subsequent instances remained stuck. The findOrCreateJob function was returning existing jobs based only on ElementId, causing job conflicts between different process instances. This fix ensures each process instance gets its own jobs by also checking ProcessInstanceKey during job lookup.
Description/Comments
The bug occurred because findOrCreateJob only checked job.ElementId == be.GetId() when looking for existing jobs, causing jobs to be shared across different process instances that had the same task IDs. The fix adds an additional check for job.ProcessInstanceKey == instance.GetInstanceKey() to ensure proper job isolation per instance. This maintains the intended behavior where jobs are reused within the same process instance but isolated between different instances.
Checklist
Depending on your PR, please ensure the overall consistency/integrity of the project remains.
Please tick just one check item per section below
Tests
Code examples
Documentation