Package io.zeebe.engine.state.instance
Class EventScopeInstanceState
- java.lang.Object
-
- io.zeebe.engine.state.instance.EventScopeInstanceState
-
public final class EventScopeInstanceState extends Object
-
-
Constructor Summary
Constructors Constructor Description EventScopeInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, DbContext dbContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreateIfNotExists(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.EventScopeInstancegetInstance(long eventScopeKey)Returns a event scope instance by key or null if none exists with this key.EventTriggerpeekEventTrigger(long eventScopeKey)Returns the next event trigger for the event scope or null if none exists.EventTriggerpollEventTrigger(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.booleantriggerEvent(long eventScopeKey, long eventKey, org.agrona.DirectBuffer elementId, org.agrona.DirectBuffer variables)
-
-
-
Constructor Detail
-
EventScopeInstanceState
public EventScopeInstanceState(ZeebeDb<ZbColumnFamilies> zeebeDb, DbContext dbContext)
-
-
Method Detail
-
shutdownInstance
public void shutdownInstance(long eventScopeKey)
If the scope exists, sets its accepting property to false.- Parameters:
eventScopeKey- the event scope key
-
createIfNotExists
public boolean createIfNotExists(long eventScopeKey, Collection<org.agrona.DirectBuffer> interruptingIds)Creates a new event scope instance in the state- 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
public void createInstance(long eventScopeKey, Collection<org.agrona.DirectBuffer> interruptingIds)Creates a new event scope instance in the state- Parameters:
eventScopeKey- the event scope keyinterruptingIds- list of element IDs which should set accepting to false
-
getInstance
public EventScopeInstance getInstance(long eventScopeKey)
Returns a event scope instance by key or null if none exists with this key.- Parameters:
eventScopeKey- the key of the event scope- Returns:
- the event scope instance or null
-
deleteInstance
public void deleteInstance(long eventScopeKey)
Delete an event scope from the state. Does not fail in case the scope does not exist.- Parameters:
eventScopeKey- the key of the event scope to delete
-
triggerEvent
public boolean triggerEvent(long eventScopeKey, long eventKey, org.agrona.DirectBuffer elementId, org.agrona.DirectBuffer variables)- 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- Returns:
- true if the event was accepted by the event scope, false otherwise
-
peekEventTrigger
public EventTrigger peekEventTrigger(long eventScopeKey)
Returns the next event trigger for the event scope or null if none exists. This will not remove the event trigger from the state.- Parameters:
eventScopeKey- the key of the event scope- Returns:
- the next event trigger or null if none exist
-
pollEventTrigger
public EventTrigger pollEventTrigger(long eventScopeKey)
Returns 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.- Parameters:
eventScopeKey- the key of the event scope- Returns:
- the next event trigger or null if none exist
-
deleteTrigger
public void deleteTrigger(long eventScopeKey, long eventKey)Deletes an event trigger by key and scope key. Does not fail if the trigger does not exist.- Parameters:
eventScopeKey- the key of the event scopeeventKey- the key of the event trigger
-
-