Class DbEventScopeInstanceState

    • Method Detail

      • createIfNotExists

        public boolean createIfNotExists​(long eventScopeKey,
                                         Collection<org.agrona.DirectBuffer> interruptingIds)
        Description copied from interface: MutableEventScopeInstanceState
        Creates a new event scope instance in the state
        Specified by:
        createIfNotExists in interface MutableEventScopeInstanceState
        Parameters:
        eventScopeKey - the event scope key
        interruptingIds - 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)
        Description copied from interface: MutableEventScopeInstanceState
        Creates a new event scope instance in the state
        Specified by:
        createInstance in interface MutableEventScopeInstanceState
        Parameters:
        eventScopeKey - the event scope key
        interruptingIds - list of element IDs which should set accepting to false
      • pollEventTrigger

        public EventTrigger pollEventTrigger​(long eventScopeKey)
        Description copied from interface: MutableEventScopeInstanceState
        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.
        Specified by:
        pollEventTrigger in interface MutableEventScopeInstanceState
        Parameters:
        eventScopeKey - the key of the event scope
        Returns:
        the next event trigger or null if none exist
      • triggerEvent

        public boolean triggerEvent​(long eventScopeKey,
                                    long eventKey,
                                    org.agrona.DirectBuffer elementId,
                                    org.agrona.DirectBuffer variables)
        Specified by:
        triggerEvent in interface MutableEventScopeInstanceState
        Parameters:
        eventScopeKey - the key of the event scope the event is triggered in
        eventKey - the key of the event record (used for ordering)
        elementId - the id of the element which should be triggered, e.g. boundary event
        variables - the variables of the occurred event, i.e. message variables
        Returns:
        true if the event was accepted by the event scope, false otherwise
      • triggerStartEvent

        public void triggerStartEvent​(long processDefinitionKey,
                                      long eventKey,
                                      org.agrona.DirectBuffer elementId,
                                      org.agrona.DirectBuffer variables)
        Description copied from interface: MutableEventScopeInstanceState
        Creates an event trigger for a process start event. Uses the process definition key as the scope key of the trigger.
        Specified by:
        triggerStartEvent in interface MutableEventScopeInstanceState
        Parameters:
        processDefinitionKey - the key of the process definition a new instance should be created of
        eventKey - the key of the event record (used for ordering)
        elementId - the id of the start event which should be triggered
        variables - the variables of the occurred event, i.e. message variables
      • deleteTrigger

        public void deleteTrigger​(long eventScopeKey,
                                  long eventKey)
        Description copied from interface: MutableEventScopeInstanceState
        Deletes an event trigger by key and scope key. Does not fail if the trigger does not exist.
        Specified by:
        deleteTrigger in interface MutableEventScopeInstanceState
        Parameters:
        eventScopeKey - the key of the event scope
        eventKey - the key of the event trigger
      • getInstance

        public EventScopeInstance getInstance​(long eventScopeKey)
        Description copied from interface: EventScopeInstanceState
        Returns a event scope instance by key or null if none exists with this key.
        Specified by:
        getInstance in interface EventScopeInstanceState
        Parameters:
        eventScopeKey - the key of the event scope
        Returns:
        the event scope instance or null
      • peekEventTrigger

        public EventTrigger peekEventTrigger​(long eventScopeKey)
        Description copied from interface: EventScopeInstanceState
        Returns 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:
        peekEventTrigger in interface EventScopeInstanceState
        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:
        isAcceptingEvent in interface EventScopeInstanceState
        Parameters:
        eventScopeKey - the key of the event scope the event is triggered in
        Returns:
        true if the event can be accepted