-
Notifications
You must be signed in to change notification settings - Fork 639
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
Support activating Inclusive Gateway via Process Instance Modification #25771
Conversation
Adds a similar case to shouldActivateParallelGateway() that shows that we can activate an inclusiveGateway (OR gateway) through an activation instruction of Process Instance Modification. This case is rather simple, activating a forking OR gateway with a single incoming sequence flow that has already been activated once before.
Adds a simple implementation to support activation of INCLUSIVE_GATEWAY (OR gateway) through activate instruction of Process Instance Modification. By adding this line, we increment all incoming sequence flows to the gateway as taken once. Note that any previously taken flows, will be simply considered as X+1, where X is the number of times that flow was already taken previously (increment). This means that, when the ProcessInstance:ACTIVATE_ELEMENT command for the gateway is processed, each of the incoming flows have been taken atleast once and so the command is not rejected. When we apply the corresponding ELEMENT_ACTIVATING event, the number of times each incoming sequence flow is decremented again, ensuring that any previously taken flows are still recorded after modification has finished.
This adds a case similar to shouldActivateInclusiveGateway() with some differences. The main goal is to check that any sequence flow that was already taken toward an inclusive gateway is retained after the process instance modification activating that same gateway. This is important to test because of the implementation of activating an inclusive gateway through modification: first increment all incoming sequence flows to the gateway as taken, and then process the activate element command for the gateway which should decrement all those flows again. As we increment and decrement we want to avoid forgetting about any previously taken ones. We can test this by activating a joining inclusive gateway, for which already one sequence flow has been taken. On modification, we expect that it activates even though there is still a token active that can reach the gateway. When that token eventually reaches the gateway, it should trigger again, as all incoming sequence flows have been taken officially now.
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.
👍 This is great, I really love that it is a one-liner to enable this 🧑🚀
🌟 Great that you tested the joining behavior as well to ensure this works as expected 🚀
Successfully created backport PR for |
Successfully created backport PR for |
Successfully created backport PR for |
Successfully created backport PR for |
Description
Adds support for activating Inclusive Gateway via a Process Instance Modification.
Specifically, adds the ability to reference an Inclusive Gateway in the activate instructions of a Process Instance Modification command. Previously, such activation instructions had no effect because the
ACTIVATE_ELEMENT
command for the gateway would be rejected.By incrementing the number of times each of its incoming sequence flows have been taken, we ensure it isn't rejected. These recorded values are decremented again after the gateway has reached the
ELEMENT_ACTIVATING
lifecycle state.These changes ensure that any previously taken sequence flows are retained after the modification has finished.
Related issues
closes #20587
closes #25099