Class DbEventScopeInstanceState
java.lang.Object
io.camunda.zeebe.engine.state.instance.DbEventScopeInstanceState
- All Implemented Interfaces:
EventScopeInstanceState,MutableEventScopeInstanceState
public final class DbEventScopeInstanceState
extends Object
implements MutableEventScopeInstanceState
-
Constructor Summary
ConstructorsConstructorDescriptionDbEventScopeInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateIfNotExists(long eventScopeKey, Collection<org.agrona.DirectBuffer> interruptingIds) Creates a new event scope instance in the statevoidcreateInstance(long eventScopeKey, Collection<org.agrona.DirectBuffer> interruptingIds) Creates a new event scope instance in the statevoiddeleteInstance(long eventScopeKey) Delete an event scope from the state.voiddeleteTrigger(long eventScopeKey, long eventKey) Deletes an event trigger by key and scope key.getInstance(long eventScopeKey) Returns a event scope instance by key or null if none exists with this key.booleanisAcceptingEvent(long eventScopeKey) peekEventTrigger(long eventScopeKey) Returns the next event trigger for the event scope or null if none exists.pollEventTrigger(long eventScopeKey) Returns the next event trigger for the event scope or null if none exists.voidshutdownInstance(long eventScopeKey) If the scope exists, sets its accepting property to false.voidtriggerEvent(long eventScopeKey, long eventKey, org.agrona.DirectBuffer elementId, org.agrona.DirectBuffer variables) Creates a new event trigger for the given event scope.voidtriggerStartEvent(long processDefinitionKey, long eventKey, org.agrona.DirectBuffer elementId, org.agrona.DirectBuffer variables) Creates an event trigger for a process start event.
-
Constructor Details
-
DbEventScopeInstanceState
public DbEventScopeInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext)
-
-
Method Details
-
shutdownInstance
public void shutdownInstance(long eventScopeKey) Description copied from interface:MutableEventScopeInstanceStateIf the scope exists, sets its accepting property to false.- Specified by:
shutdownInstancein interfaceMutableEventScopeInstanceState- Parameters:
eventScopeKey- the event scope key
-
createIfNotExists
public boolean createIfNotExists(long eventScopeKey, Collection<org.agrona.DirectBuffer> interruptingIds) Description copied from interface:MutableEventScopeInstanceStateCreates a new event scope instance in the state- Specified by:
createIfNotExistsin interfaceMutableEventScopeInstanceState- Parameters:
eventScopeKey- the event scope keyinterruptingIds- list of element IDs which should set accepting to false- Returns:
- whether the scope was created or not
-
createInstance
Description copied from interface:MutableEventScopeInstanceStateCreates a new event scope instance in the state- Specified by:
createInstancein interfaceMutableEventScopeInstanceState- Parameters:
eventScopeKey- the event scope keyinterruptingIds- list of element IDs which should set accepting to false
-
deleteInstance
public void deleteInstance(long eventScopeKey) Description copied from interface:MutableEventScopeInstanceStateDelete an event scope from the state. Does not fail in case the scope does not exist.- Specified by:
deleteInstancein interfaceMutableEventScopeInstanceState- Parameters:
eventScopeKey- the key of the event scope to delete
-
pollEventTrigger
Description copied from interface:MutableEventScopeInstanceStateReturns the next event trigger for the event scope or null if none exists. This will remove the polled event trigger from the state if it exists.- Specified by:
pollEventTriggerin interfaceMutableEventScopeInstanceState- Parameters:
eventScopeKey- the key of the event scope- Returns:
- the next event trigger or null if none exist
-
triggerEvent
public void triggerEvent(long eventScopeKey, long eventKey, org.agrona.DirectBuffer elementId, org.agrona.DirectBuffer variables) Description copied from interface:MutableEventScopeInstanceStateCreates a new event trigger for the given event scope. Ignores the trigger if the event scope is not accepting anymore or doesn't exist.- Specified by:
triggerEventin interfaceMutableEventScopeInstanceState- Parameters:
eventScopeKey- the key of the event scope the event is triggered ineventKey- the key of the event record (used for ordering)elementId- the id of the element which should be triggered, e.g. boundary eventvariables- the variables of the occurred event, i.e. message variables
-
triggerStartEvent
public void triggerStartEvent(long processDefinitionKey, long eventKey, org.agrona.DirectBuffer elementId, org.agrona.DirectBuffer variables) Description copied from interface:MutableEventScopeInstanceStateCreates an event trigger for a process start event. Uses the process definition key as the scope key of the trigger.- Specified by:
triggerStartEventin interfaceMutableEventScopeInstanceState- Parameters:
processDefinitionKey- the key of the process definition a new instance should be created ofeventKey- the key of the event record (used for ordering)elementId- the id of the start event which should be triggeredvariables- the variables of the occurred event, i.e. message variables
-
deleteTrigger
public void deleteTrigger(long eventScopeKey, long eventKey) Description copied from interface:MutableEventScopeInstanceStateDeletes an event trigger by key and scope key. Does not fail if the trigger does not exist.- Specified by:
deleteTriggerin interfaceMutableEventScopeInstanceState- Parameters:
eventScopeKey- the key of the event scopeeventKey- the key of the event trigger
-
getInstance
Description copied from interface:EventScopeInstanceStateReturns a event scope instance by key or null if none exists with this key.- Specified by:
getInstancein interfaceEventScopeInstanceState- Parameters:
eventScopeKey- the key of the event scope- Returns:
- the event scope instance or null
-
peekEventTrigger
Description copied from interface:EventScopeInstanceStateReturns the next event trigger for the event scope or null if none exists. This will not remove the event trigger from the state.- Specified by:
peekEventTriggerin interfaceEventScopeInstanceState- Parameters:
eventScopeKey- the key of the event scope- Returns:
- the next event trigger or null if none exist
-
isAcceptingEvent
public boolean isAcceptingEvent(long eventScopeKey) - Specified by:
isAcceptingEventin interfaceEventScopeInstanceState- Parameters:
eventScopeKey- the key of the event scope the event is triggered in- Returns:
- true if the event can be accepted
-