Interface ElementInstanceState

All Known Subinterfaces:
MutableElementInstanceState
All Known Implementing Classes:
DbElementInstanceState

public interface ElementInstanceState
  • Method Details

    • getInstance

      ElementInstance getInstance(long key)
    • getChildren

      List<ElementInstance> getChildren(long parentKey)
    • forEachChild

      void forEachChild(long parentKey, long startAtKey, BiFunction<Long,ElementInstance,Boolean> visitor)
      Applies 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 startAtKey indicates where the iteration should start. If the key exists, the first key-value-pair will contain the equal key as startAtKey. If the key doesn't exist it will start after.

      Parameters:
      parentKey - the key of the parent element instance
      startAtKey - the element instance key of child the iteration should start at
      visitor - the visitor which is applied for each child
    • getAwaitResultRequestMetadata

      AwaitProcessInstanceResultMetadata getAwaitResultRequestMetadata(long processInstanceKey)
    • getNumberOfTakenSequenceFlows

      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. 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.

      Parameters:
      flowScopeKey - the key of the flow scope that contains the gateway
      gatewayElementId - the element id of the gateway
      Returns:
      the number of taken sequence flows of the given gateway
    • getProcessInstanceKeysByDefinitionKey

      List<Long> getProcessInstanceKeysByDefinitionKey(long processDefinitionKey)
      Returns a list of process instance keys that belong to a specific process definition.

      Caution: This will also return the keys of banned process instances!

      Parameters:
      processDefinitionKey - the key of the process definition
      Returns:
      a list of process instance keys
    • hasActiveProcessInstances

      boolean hasActiveProcessInstances(long processDefinitionKey, List<Long> bannedInstances)
      Verifies if there are active process instances for a given process definition
      Parameters:
      processDefinitionKey - the key of the process definition
      bannedInstances - a list of banned process instance keys
      Returns:
      a boolean indicating if there are running instances