Class DbElementInstanceState
- java.lang.Object
-
- io.camunda.zeebe.engine.state.instance.DbElementInstanceState
-
- All Implemented Interfaces:
ElementInstanceState
,MutableElementInstanceState
public final class DbElementInstanceState extends Object implements MutableElementInstanceState
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DbElementInstanceState.RecordVisitor
-
Constructor Summary
Constructors Constructor Description DbElementInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, MutableVariableState variableState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.AwaitProcessInstanceResultMetadata
getAwaitResultRequestMetadata(long processInstanceKey)
List<ElementInstance>
getChildren(long parentKey)
ElementInstance
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.ElementInstance
newInstance(long key, ProcessInstanceRecord value, ProcessInstanceIntent state)
ElementInstance
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 Detail
-
DbElementInstanceState
public DbElementInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, MutableVariableState variableState)
-
-
Method Detail
-
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
-
updateInstance
public void updateInstance(ElementInstance scopeInstance)
- Specified by:
updateInstance
in interfaceMutableElementInstanceState
-
updateInstance
public void updateInstance(long key, Consumer<ElementInstance> modifier)
- 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
public ElementInstance getInstance(long key)
- Specified by:
getInstance
in interfaceElementInstanceState
-
getChildren
public List<ElementInstance> getChildren(long parentKey)
- Specified by:
getChildren
in interfaceElementInstanceState
-
getAwaitResultRequestMetadata
public AwaitProcessInstanceResultMetadata getAwaitResultRequestMetadata(long processInstanceKey)
- 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
-
-