Class DbElementInstanceState
java.lang.Object
io.camunda.zeebe.engine.state.instance.DbElementInstanceState
- All Implemented Interfaces:
ElementInstanceState,MutableElementInstanceState
-
Constructor Summary
ConstructorsConstructorDescriptionDbElementInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, MutableVariableState variableState) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateInstance(ElementInstance instance) voiddecrementNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Decrements the numbers that counts how often a sequence flow of the given gateway has been taken.voidforEachChild(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) intgetNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Returns the number of the taken sequence flows that are connected to the given parallel (joining) gateway.voidincrementNumberOfTakenSequenceFlows(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) voidremoveInstance(long key) voidsetAwaitResultRequestMetadata(long processInstanceKey, AwaitProcessInstanceResultMetadata metadata) voidupdateInstance(long key, Consumer<ElementInstance> modifier) voidupdateInstance(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:
newInstancein interfaceMutableElementInstanceState
-
newInstance
public ElementInstance newInstance(ElementInstance parent, long key, ProcessInstanceRecord value, ProcessInstanceIntent state) - Specified by:
newInstancein interfaceMutableElementInstanceState
-
removeInstance
public void removeInstance(long key) - Specified by:
removeInstancein interfaceMutableElementInstanceState
-
createInstance
- Specified by:
createInstancein interfaceMutableElementInstanceState
-
updateInstance
- Specified by:
updateInstancein interfaceMutableElementInstanceState
-
updateInstance
- Specified by:
updateInstancein interfaceMutableElementInstanceState
-
setAwaitResultRequestMetadata
public void setAwaitResultRequestMetadata(long processInstanceKey, AwaitProcessInstanceResultMetadata metadata) - Specified by:
setAwaitResultRequestMetadatain interfaceMutableElementInstanceState
-
incrementNumberOfTakenSequenceFlows
public void incrementNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId, org.agrona.DirectBuffer sequenceFlowElementId) Description copied from interface:MutableElementInstanceStateIncrements 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:
incrementNumberOfTakenSequenceFlowsin 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:MutableElementInstanceStateDecrements 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:
decrementNumberOfTakenSequenceFlowsin interfaceMutableElementInstanceState- Parameters:
flowScopeKey- the key of the flow scope that contains the gatewaygatewayElementId- the element id of the gateway
-
getInstance
- Specified by:
getInstancein interfaceElementInstanceState
-
getChildren
- Specified by:
getChildrenin interfaceElementInstanceState
-
forEachChild
public void forEachChild(long parentKey, long startAtKey, BiFunction<Long, ElementInstance, Boolean> visitor) Description copied from interface:ElementInstanceStateApplies 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
startAtKeyindicates 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:
forEachChildin 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:
getAwaitResultRequestMetadatain interfaceElementInstanceState
-
getNumberOfTakenSequenceFlows
public int getNumberOfTakenSequenceFlows(long flowScopeKey, org.agrona.DirectBuffer gatewayElementId) Description copied from interface:ElementInstanceStateReturns 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:
getNumberOfTakenSequenceFlowsin 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
-