Skip to content
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

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

korthout
Copy link
Member

@korthout korthout commented Dec 9, 2024

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

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.
@korthout korthout added backport stable/8.3 Backport a pull request to 8.3.x backport stable/8.4 Backport a pull request to 8.4.x backport stable/8.5 Backport a pull request to stable/8.5 backport stable/8.6 Backport a pull request to stable/8.6 labels Dec 9, 2024
@github-actions github-actions bot added the component/zeebe Related to the Zeebe component/team label Dec 9, 2024
@tmetzke tmetzke self-requested a review December 9, 2024 18:34
Copy link
Member

@tmetzke tmetzke left a 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 🚀

@korthout korthout added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit 933e6bf Dec 9, 2024
78 of 81 checks passed
@korthout korthout deleted the korthout-20587-activate-or-gateway-via-modify branch December 9, 2024 19:00
@backport-action
Copy link
Collaborator

@backport-action
Copy link
Collaborator

@backport-action
Copy link
Collaborator

@backport-action
Copy link
Collaborator

github-merge-queue bot pushed a commit that referenced this pull request Dec 9, 2024
…s Instance Modification (#25788)

# Description
Backport of #25771 to `stable/8.6`.

relates to #20587 #25099
original author: @korthout
github-merge-queue bot pushed a commit that referenced this pull request Dec 10, 2024
…s Instance Modification (#25785)

# Description
Backport of #25771 to `stable/8.3`.

relates to #20587 #25099
original author: @korthout
github-merge-queue bot pushed a commit that referenced this pull request Dec 10, 2024
…s Instance Modification (#25787)

# Description
Backport of #25771 to `stable/8.5`.

relates to #20587 #25099
original author: @korthout
github-merge-queue bot pushed a commit that referenced this pull request Dec 10, 2024
…s Instance Modification (#25786)

# Description
Backport of #25771 to `stable/8.4`.

relates to #20587 #25099
original author: @korthout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable/8.3 Backport a pull request to 8.3.x backport stable/8.4 Backport a pull request to 8.4.x backport stable/8.5 Backport a pull request to stable/8.5 backport stable/8.6 Backport a pull request to stable/8.6 component/zeebe Related to the Zeebe component/team version:8.3.19 version:8.4.15 version:8.5.11 version:8.6.7
Projects
None yet
3 participants