Interface ElementInstanceState
- All Known Subinterfaces:
MutableElementInstanceState
- All Known Implementing Classes:
DbElementInstanceState
public interface ElementInstanceState
-
Method Summary
Modifier and TypeMethodDescriptionvoid
forEachChild
(long parentKey, long startAtKey, BiFunction<Long, ElementInstance, Boolean> visitor) Applies the provided visitor to each child element of the given parent.getAwaitResultRequestMetadata
(long processInstanceKey) getChildren
(long parentKey) getInstance
(long key) int
getNumberOfTakenSequenceFlows
(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Returns the number of the taken sequence flows that are connected to the given parallel (joining) gateway.getProcessInstanceKeysByDefinitionKey
(long processDefinitionKey) Returns a list of process instance keys that belong to a specific process definition.boolean
hasActiveProcessInstances
(long processDefinitionKey) Verifies if there are active process instances for a given process definition
-
Method Details
-
getInstance
-
getChildren
-
forEachChild
void forEachChild(long parentKey, long startAtKey, BiFunction<Long, ElementInstance, Boolean> visitor) Applies the provided visitor to each child element of the given parent. The visitor can indicate via the return value, whether the iteration should continue or not. This means if the visitor returns false the iteration will stop.The given
startAtKey
indicates where the iteration should start. If the key exists, the first key-value-pair will contain the equal key asstartAtKey
. If the key doesn't exist it will start after.- Parameters:
parentKey
- the key of the parent element instancestartAtKey
- the element instance key of child the iteration should start atvisitor
- the visitor which is applied for each child
-
getAwaitResultRequestMetadata
-
getNumberOfTakenSequenceFlows
int getNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Returns the number of the taken sequence flows that are connected to the given parallel (joining) gateway. Each sequence flow counts only as one, even if it is taken multiple times.The number helps to determine if a parallel gateway can be activated or not.
- Parameters:
flowScopeKey
- the key of the flow scope that contains the gatewaygatewayElementId
- the element id of the gateway- Returns:
- the number of taken sequence flows of the given gateway
-
getProcessInstanceKeysByDefinitionKey
Returns a list of process instance keys that belong to a specific process definition.Caution: This will also return the keys of banned process instances!
- Parameters:
processDefinitionKey
- the key of the process definition- Returns:
- a list of process instance keys
-
hasActiveProcessInstances
boolean hasActiveProcessInstances(long processDefinitionKey) Verifies if there are active process instances for a given process definition- Parameters:
processDefinitionKey
- the key of the process definition- Returns:
- a boolean indicating if there are running instances
-