-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10609: Remove interrupted state on event subprocess activation r=remcowesterhoud a=remcowesterhoud ## Description <!-- Please explain the changes you made here. --> When an interrupting event sub process gets triggered it will terminate all active element in its flow scope and mark the flow scope as interrupted. With process instance modification it should be possible to re-activate element within the interrupted scope. Because of the interrupted state any activate commands get rejected, making this currently impossible. With this change we will check if any of the activated elements is currently in an interrupted state. If this is the case we will remove this state, allowing elements within to be activated through a modification. ## Related issues <!-- Which issues are closed by this PR or are related --> closes #10477 Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
- Loading branch information
Showing
7 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
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
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
37 changes: 37 additions & 0 deletions
37
...main/java/io/camunda/zeebe/engine/state/appliers/ProcessInstanceModifiedEventApplier.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.engine.state.appliers; | ||
|
||
import io.camunda.zeebe.engine.state.TypedEventApplier; | ||
import io.camunda.zeebe.engine.state.instance.ElementInstance; | ||
import io.camunda.zeebe.engine.state.mutable.MutableElementInstanceState; | ||
import io.camunda.zeebe.protocol.impl.record.value.processinstance.ProcessInstanceModificationRecord; | ||
import io.camunda.zeebe.protocol.record.intent.ProcessInstanceModificationIntent; | ||
|
||
final class ProcessInstanceModifiedEventApplier | ||
implements TypedEventApplier< | ||
ProcessInstanceModificationIntent, ProcessInstanceModificationRecord> { | ||
|
||
private final MutableElementInstanceState elementInstanceState; | ||
|
||
public ProcessInstanceModifiedEventApplier( | ||
final MutableElementInstanceState elementInstanceState) { | ||
this.elementInstanceState = elementInstanceState; | ||
} | ||
|
||
@Override | ||
public void applyState(final long key, final ProcessInstanceModificationRecord value) { | ||
value.getActivatedElementInstanceKeys().stream() | ||
.map(elementInstanceState::getInstance) | ||
.filter(ElementInstance::isInterrupted) | ||
.forEach( | ||
instance -> | ||
elementInstanceState.updateInstance( | ||
instance.getKey(), ElementInstance::clearInterruptedState)); | ||
} | ||
} |
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
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
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
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