-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger boundary events after an interrupting event subprocess is triggered #9175
Conversation
* if an interrupting event subprocess is triggered then remove the subscriptions of other event subprocesses in the same flow scope * but don't remove the subscriptions of boundary events that are attached to the scope * the boundary events can be still triggered because they are attached to the scope and are not inside of it
* remove methods from event scope instance state that are only used in tests but not in production code * these methods were used previously but are not needed anymore
* migrate the test case from JUnit 4 to JUnit 5 using the Zeebe state extension
fd346e8
to
b9423e3
Compare
* handle interrupting event subprocesses and interrupting boundary events differently by introducing boundary element ids * an interrupting event subprocess interrupts the event scope, but it can still be triggered by boundary events * after an interrupting boundary event is triggered, no other event can be triggered for the event scope
b9423e3
to
07cca46
Compare
Off the top of my head: Wouldn't we need some sort of migration to initialize |
Good question 👍 We could migrate the state to fix the behavior of the existing event scopes. If we don't migrate the state then the behavior is fixed only for event scopes that are created are the update to the new version. But I think this is okay. We're not aware of critical processes that are stuck in this situation. |
I think it would be of course nice to have a fix which also works for existing scopes, do we have any feeling about how complex this migration would be?
I'm always not sure how much we should rely on this, as I'm looking from a user perspective how would I know or understand that the engine has a bug in this case? I.e. a user would have to notice that a boundary event was not triggered, how would the user figure that out? |
Mid. We would need to fetch some data to update the event scopes properly. And we would need to test the migration. We could do it but it would take more time. I think it is not worth implementing the migration. Currently, we have this bug. When the cluster is updated to the new version then the bug will be fixed for any new process instance (i.e. or any new event scope of existing process instances). If a user has an existing process instance and runs into the bug then the user can start a new process instance to mitigate the issue. |
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.
Reviewed all changes except for tests. I have a couple of questions to further my understanding.
Please have a look. Let's first clear up the questions either here or f2f, as you deem more effective and then I would look at the tests again.
engine/src/main/java/io/camunda/zeebe/engine/processing/common/CatchEventBehavior.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/processing/common/CatchEventBehavior.java
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/processing/common/EventTriggerBehavior.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/processing/common/EventTriggerBehavior.java
Outdated
Show resolved
Hide resolved
...ain/java/io/camunda/zeebe/engine/processing/deployment/model/element/ExecutableActivity.java
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/processing/timer/TriggerTimerProcessor.java
Show resolved
Hide resolved
...ain/java/io/camunda/zeebe/engine/state/appliers/ProcessInstanceElementActivatingApplier.java
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/state/instance/DbEventScopeInstanceState.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/state/instance/DbEventScopeInstanceState.java
Show resolved
Hide resolved
2357a9d
to
be2d3d6
Compare
@pihme I applied some of your review hints and answer your questions ✔️ |
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.
From my side, I would like to see a change regarding the naming of the methods I mentioned in earlier comments.
Regarding whether or not to add db migration code + tests, I am open to defer this to a follow up issue (which can then be prioritized independently). But in general, I feel we should make it a habit to write migration code and tests whenever we make changes to the database.
engine/src/test/java/io/camunda/zeebe/engine/state/instance/EventScopeInstanceStateTest.java
Show resolved
Hide resolved
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.
Looking forward to seeing this merged!
bors merge |
9175: Trigger boundary events after an interrupting event subprocess is triggered r=saig0 a=saig0 ## Description Fixing the issue that boundary events can't be triggered after an interrupting event subprocess is triggered on the scope. Solve the issue by: * avoid that event subscriptions of boundary event are removed when an interrupting event scope is triggered * introduce a filter when removing the event subscriptions * filter by event subprocesses and ignore other event subscriptions * extend the event scope instance state to distinguish interrupting event subscriptions from boundary events * add the property `boundaryElementIds` for event scopes to distinguish boundary events from other events in the scope * add the property `interrupted` for event scopes to mark if an interrupting event (subprocess) is triggered * if the event scope is interrupted then no other interrupting or non-interrupting events can be triggered * only boundary events can be triggered for an interrupted event scope * if an interrupting boundary event is triggered then the event scope doesn't accept any other event Maintenance: * remove methods from the event scope state that are not used in production code * migrate the event scope state test to JUnit 5 ## Related issues closes #6874 Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
Build failed: |
bors merge |
Backport failed for Please cherry-pick the changes locally. git fetch origin stable/1.3
git worktree add -d .worktree/backport-9175-to-stable/1.3 origin/stable/1.3
cd .worktree/backport-9175-to-stable/1.3
git checkout -b backport-9175-to-stable/1.3
ancref=$(git merge-base 7905399440295deee368274a23877744a283596c 7791618b9c2c4f44870e64d0255e7fe1472af546)
git cherry-pick -x $ancref..7791618b9c2c4f44870e64d0255e7fe1472af546 |
Backport failed for Please cherry-pick the changes locally. git fetch origin stable/8.0
git worktree add -d .worktree/backport-9175-to-stable/8.0 origin/stable/8.0
cd .worktree/backport-9175-to-stable/8.0
git checkout -b backport-9175-to-stable/8.0
ancref=$(git merge-base 7905399440295deee368274a23877744a283596c 7791618b9c2c4f44870e64d0255e7fe1472af546)
git cherry-pick -x $ancref..7791618b9c2c4f44870e64d0255e7fe1472af546 |
Description
Fixing the issue that boundary events can't be triggered after an interrupting event subprocess is triggered on the scope.
Solve the issue by:
boundaryElementIds
for event scopes to distinguish boundary events from other events in the scopeinterrupted
for event scopes to mark if an interrupting event (subprocess) is triggeredMaintenance:
Related issues
closes #6874
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation: