Class DbElementInstanceState
java.lang.Object
io.camunda.zeebe.engine.state.instance.DbElementInstanceState
- All Implemented Interfaces:
ElementInstanceState
,MutableElementInstanceState
-
Constructor Summary
ConstructorDescriptionDbElementInstanceState
(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, MutableVariableState variableState) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createInstance
(ElementInstance instance) void
decrementNumberOfTakenSequenceFlows
(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Decrements the numbers that counts how often a sequence flow of the given gateway has been taken.void
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.void
incrementNumberOfTakenSequenceFlows
(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId, org.agrona.DirectBuffer sequenceFlowElementId) Increments the number that counts how often the given sequence flow has been taken.newInstance
(long key, ProcessInstanceRecord value, ProcessInstanceIntent state) newInstance
(ElementInstance parent, long key, ProcessInstanceRecord value, ProcessInstanceIntent state) void
removeInstance
(long key) void
setAwaitResultRequestMetadata
(long processInstanceKey, AwaitProcessInstanceResultMetadata metadata) void
updateInstance
(long key, Consumer<ElementInstance> modifier) void
updateInstance
(ElementInstance scopeInstance)
-
Constructor Details
-
DbElementInstanceState
public DbElementInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, MutableVariableState variableState)
-
-
Method Details
-
newInstance
public ElementInstance newInstance(long key, ProcessInstanceRecord value, ProcessInstanceIntent state) - Specified by:
newInstance
in interfaceMutableElementInstanceState
-
newInstance
public ElementInstance newInstance(ElementInstance parent, long key, ProcessInstanceRecord value, ProcessInstanceIntent state) - Specified by:
newInstance
in interfaceMutableElementInstanceState
-
removeInstance
public void removeInstance(long key) - Specified by:
removeInstance
in interfaceMutableElementInstanceState
-
createInstance
- Specified by:
createInstance
in interfaceMutableElementInstanceState
-
updateInstance
- Specified by:
updateInstance
in interfaceMutableElementInstanceState
-
updateInstance
- Specified by:
updateInstance
in interfaceMutableElementInstanceState
-
setAwaitResultRequestMetadata
public void setAwaitResultRequestMetadata(long processInstanceKey, AwaitProcessInstanceResultMetadata metadata) - Specified by:
setAwaitResultRequestMetadata
in interfaceMutableElementInstanceState
-
incrementNumberOfTakenSequenceFlows
public void incrementNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId, org.agrona.DirectBuffer sequenceFlowElementId) Description copied from interface:MutableElementInstanceState
Increments the number that counts how often the given sequence flow has been taken.The number helps to determine if a parallel gateway can be activated or not. It should be incremented when one of the incoming sequence flows is taken.
- Specified by:
incrementNumberOfTakenSequenceFlows
in interfaceMutableElementInstanceState
- Parameters:
flowScopeKey
- the key of the flow scope that contains the gatewaygatewayElementId
- the element id of the gateway that is the target of the sequence flowsequenceFlowElementId
- the element id of the sequence flow that is taken
-
decrementNumberOfTakenSequenceFlows
public void decrementNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Description copied from interface:MutableElementInstanceState
Decrements the numbers that counts how often a sequence flow of the given gateway has been taken.The number helps to determine if a parallel gateway can be activated or not. It should be decremented when the gateway is activated.
- Specified by:
decrementNumberOfTakenSequenceFlows
in interfaceMutableElementInstanceState
- Parameters:
flowScopeKey
- the key of the flow scope that contains the gatewaygatewayElementId
- the element id of the gateway
-
getInstance
- Specified by:
getInstance
in interfaceElementInstanceState
-
getChildren
- Specified by:
getChildren
in interfaceElementInstanceState
-
forEachChild
public void forEachChild(long parentKey, long startAtKey, BiFunction<Long, ElementInstance, Boolean> visitor) Description copied from interface:ElementInstanceState
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.- Specified by:
forEachChild
in interfaceElementInstanceState
- 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
- Specified by:
getAwaitResultRequestMetadata
in interfaceElementInstanceState
-
getNumberOfTakenSequenceFlows
public int getNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Description copied from interface:ElementInstanceState
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.
- Specified by:
getNumberOfTakenSequenceFlows
in interfaceElementInstanceState
- 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
-