-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Migrate compensation boundary event subscriptions only by boundary event mapping #24568
Merged
berkaycanbc
merged 6 commits into
main
from
bcan_24487_rejections-for-invalid-compensation-boundary-event-mappings
Nov 14, 2024
Merged
Migrate compensation boundary event subscriptions only by boundary event mapping #24568
berkaycanbc
merged 6 commits into
main
from
bcan_24487_rejections-for-invalid-compensation-boundary-event-mappings
Nov 14, 2024
Conversation
This file contains 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
Compensation subscription migration tests are updated to only provide mapping between boundary events.
d3b279c
to
964fede
Compare
The code is executed in following steps: - Retrieve all compensation subscriptions of the process instance - Filter subscriptions that are belong tasks only and return the compensable activity task of it - For each compensable activity, if mapped with mapping instructions, retrieve target activity. Then, return source and target activity together inside CompensableElementMapping object. - For each source and target activity mapping: - If both source and target activity is in at the root level, return them immediately - If they are inside another flow scope (e.g. inside subprocess), recursively call the same method for their flow scopes until reaching the root process scope. - If there is a scope difference, that means user tries to change the flow scope of the compensation subscription. We do not allow changing the flow scope of elements. (this rule also applies to all other elements as previously implemented in preconditions)
964fede
to
9d5c992
Compare
nicpuppa
approved these changes
Nov 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good 👍
Tests are added for the following: - If handler type is changed, the flow should still work in the target process (e.g. handler was service task in source and became subprocess in target) - Compensation subscription migration should work for multi instance compensation handlers
Previously, we were receiving the compensable task by calling getElementById with the expected type. But when getElementById is called with the expected type ExecutableActivity, it will return the inner instance of the multi instance body, which is wrong. We wanted to retrieve the multi instance body element itself. Later, we can retrieve its boundary events correctly. A new method `getCompensableActivity()` is implemented to do casting manually and used in related places.
@nicpuppa I've spotted a bug related to multi instance handlers. I've sent the fix. Please take another look. 👀 |
nicpuppa
approved these changes
Nov 13, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Description
Check related issue description and commit messages for details.
Related issues
closes #24487