Interface ProcessInstance<T>


public interface ProcessInstance<T>
  • Field Details

  • Method Details

    • process

      Process<T> process()
      Returns process definition associated with this process instance
      Returns:
      process definition of this process instance
    • start

      void start()
      Starts process instance
    • start

      void start(String trigger, String referenceId)
      Starts process instance with trigger
      Parameters:
      trigger - name of the trigger that will indicate what start node to trigger
      referenceId - optional reference id that points to a another component triggering this instance
    • start

      void start(String trigger, String referenceId, Map<String,List<String>> headers)
      Starts process instance with trigger
      Parameters:
      trigger - name of the trigger that will indicate what start node to trigger
      referenceId - optional reference id that points to a another component triggering this instance
      headers - process headers
    • start

      void start(Map<String,List<String>> headers)
      Starts process instance with trigger and headers
      Parameters:
      trigger - name of the trigger that will indicate what start node to trigger
      headers - list of headers
    • startFrom

      void startFrom(String nodeId)
      Starts process instance from given node
      Parameters:
      nodeId - node id that should be used as the first node
    • startFrom

      void startFrom(String startFromNodeId, Map<String,List<String>> headers)
      Starts process instance from given node and headers
      Parameters:
      nodeId - node id that should be used as the first node
      headers - list of headers
    • startFrom

      void startFrom(String nodeId, String referenceId)
      Starts process instance from given node
      Parameters:
      nodeId - node id that should be used as the first node
      referenceId - optional reference id that points to a another component triggering this instance
    • startFrom

      void startFrom(String nodeId, String referenceId, Map<String,List<String>> headers)
      Starts process instance from given node
      Parameters:
      nodeId - node id that should be used as the first node
      referenceId - optional reference id that points to a another component triggering this instance
      headers - process headers
    • send

      <S> void send(Signal<S> signal)
      Sends given signal into this process instance
      Parameters:
      signal - signal to be processed
    • abort

      void abort()
      Aborts this process instance
    • variables

      T variables()
      Returns process variables of this process instance
      Returns:
      variables of the process instance
    • updateVariables

      T updateVariables(T updates)
      Updates process variables of this process instance
    • updateVariablesPartially

      T updateVariablesPartially(T updates)
      Partially updates process variables of this process instance Partial means that null values are ignored.
    • status

      int status()
      Returns current status of this process instance
      Returns:
      the current status
    • completeWorkItem

      void completeWorkItem(String id, Map<String,Object> variables, Policy... policies)
      Completes work item belonging to this process instance with given variables
      Parameters:
      id - id of the work item to complete
      variables - optional variables
      policies - optional list of policies to be enforced
    • updateWorkItem

      <R> R updateWorkItem(String id, Function<KogitoWorkItem,R> updater, Policy... policies)
      Updates work item according to provided consumer
      Parameters:
      id - the id of the work item that has been completed
      updater - consumer implementation that contains the logic to update workitem
      policies - optional security information
      Returns:
      result of the operation performed by the updater
    • abortWorkItem

      void abortWorkItem(String id, Policy... policies)
      Aborts work item belonging to this process instance
      Parameters:
      id - id of the work item to complete
      policies - optional list of policies to be enforced
    • transitionWorkItem

      void transitionWorkItem(String id, WorkItemTransition transition)
      Transition work item belonging to this process instance not another life cycle phase
      Parameters:
      id - id of the work item to complete
      transition - target transition including phase, identity and data
    • workItem

      WorkItem workItem(String workItemId, Policy... policies)
      Returns work item identified by given id if found
      Parameters:
      workItemId - id of the work item
      policies - optional list of policies to be enforced
      Returns:
      work item with its parameters if found
    • findNodes

      Return nodes that fulfills a particular filter
      Returns:
      collections of nodes that match the filter
    • workItems

      List<WorkItem> workItems(Policy... policies)
      Returns list of currently active work items.
      Parameters:
      policies - optional list of policies to be enforced
      Returns:
      list of work items
    • workItems

      List<WorkItem> workItems(Predicate<KogitoNodeInstance> p, Policy... policies)
      Returns list of filtered work items
      Parameters:
      p - the predicate to be applied to the node holding the work item
      Returns:
      list of work items
    • id

      String id()
      Returns identifier of this process instance
      Returns:
      id of the process instance
    • businessKey

      String businessKey()
      Returns optional business key associated with this process instance
      Returns:
      business key if available otherwise null
    • description

      String description()
      Returns optional description of this process instance
      Returns:
      description of the process instance
    • startDate

      Date startDate()
      Returns startDate of this process instance
      Returns:
    • error

      Returns process error in case process instance is in error state.
      Returns:
      returns process error
    • checkError

      default ProcessInstance<T> checkError()
    • triggerNode

      void triggerNode(String nodeId)
    • cancelNodeInstance

      void cancelNodeInstance(String nodeInstanceId)
    • retriggerNodeInstance

      void retriggerNodeInstance(String nodeInstanceId)
    • events

      Set<EventDescription<?>> events()
    • milestones

      Collection<Milestone> milestones()
      Returns the process milestones
      Returns:
      All the process milestones with their current status
    • adHocFragments

      Collection<AdHocFragment> adHocFragments()
      Returns the process adHocFragments
      Returns:
      All the AdHocFragment in the process
    • version

      long version()
    • correlation

      Optional<? extends Correlation<?>> correlation()