Skip to content

Commit

Permalink
[Backport stable/8.4] Support activating Inclusive Gateway via Proces…
Browse files Browse the repository at this point in the history
…s Instance Modification (#25786)

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

relates to #20587 #25099
original author: @korthout
  • Loading branch information
korthout authored Dec 10, 2024
2 parents 7a444cc + 74176cc commit 4bebb13
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ private void incrementNumberOfTakenSequenceFlows(
instruction -> {
final var element =
process.getElementById(instruction.getElementId(), ExecutableFlowNode.class);
if (!element.getElementType().equals(BpmnElementType.PARALLEL_GATEWAY)) {
if (!element.getElementType().equals(BpmnElementType.PARALLEL_GATEWAY)
&& !element.getElementType().equals(BpmnElementType.INCLUSIVE_GATEWAY)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,49 @@ public void shouldActivateParallelGateway() {
.hasSize(4);
}

@Test
public void shouldActivateInclusiveGateway() {
// given
ENGINE
.deployment()
.withXmlResource(
Bpmn.createExecutableProcess(PROCESS_ID)
.startEvent()
.inclusiveGateway("fork")
.conditionExpression("true")
.serviceTask("A", a -> a.zeebeJobType("A"))
.endEvent()
.moveToNode("fork")
.conditionExpression("true")
.serviceTask("B", b -> b.zeebeJobType("B"))
.endEvent()
.done())
.deploy();

final var processInstanceKey = ENGINE.processInstance().ofBpmnProcessId(PROCESS_ID).create();

Assertions.assertThat(
RecordingExporter.jobRecords(JobIntent.CREATED)
.withProcessInstanceKey(processInstanceKey)
.limit(2))
.hasSize(2);

// when
ENGINE
.processInstance()
.withInstanceKey(processInstanceKey)
.modification()
.activateElement("fork")
.modify();

// then
Assertions.assertThat(
RecordingExporter.jobRecords(JobIntent.CREATED)
.withProcessInstanceKey(processInstanceKey)
.limit(4))
.hasSize(4);
}

@Test
public void verifyCallActivityWithIncidentInOutputMappingCanBeTerminated() {
final var child = Bpmn.createExecutableProcess("child").startEvent().endEvent().done();
Expand Down

0 comments on commit 4bebb13

Please sign in to comment.