Package org.jbpm.workflow.instance.impl

## Class WorkflowProcessInstanceImpl

- java.lang.Object
- - org.jbpm.process.instance.impl.ProcessInstanceImpl
  - - org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl

- All Implemented Interfaces:
    `Serializable`, `ContextableInstance`, `ContextInstanceContainer`, `ProcessInstance`, `NodeInstanceContainer`, `WorkflowProcessInstance`, `org.kie.api.runtime.process.EventListener`, `org.kie.api.runtime.process.NodeInstanceContainer`, `org.kie.api.runtime.process.ProcessInstance`, `org.kie.api.runtime.process.WorkflowProcessInstance`
  Direct Known Subclasses:
    `RuleFlowProcessInstance`

      public abstract class WorkflowProcessInstanceImpl
      extends ProcessInstanceImpl
      implements WorkflowProcessInstance, NodeInstanceContainer

  Default implementation of a RuleFlow process instance.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface org.kie.api.runtime.process.ProcessInstance

      `SLA_ABORTED, SLA_MET, SLA_NA, SLA_PENDING, SLA_VIOLATED, STATE_ABORTED, STATE_ACTIVE, STATE_COMPLETED, STATE_PENDING, STATE_SUSPENDED`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WorkflowProcessInstanceImpl()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addActivatingNodeId​(String uniqueId)` |
    `void` | `addCompletedNodeId​(String uniqueId)` |
    `void` | `addEventListener​(String type, org.kie.api.runtime.process.EventListener listener, boolean external)` |
    `void` | `addNodeInstance​(NodeInstance nodeInstance)` |
    `void` | `configureSLA()` |
    `TimerInstance` | `configureSLATimer​(String slaDueDateExpression)` |
    `TimerInstance` | `configureSLATimer​(String slaDueDateExpression, String timerName)` |
    `void` | `disconnect()` |
    `List<String>` | `getActivatingNodeIds()` |
    `List<String>` | `getActiveNodeIds()` |
    `org.kie.api.runtime.rule.AgendaFilter` | `getAgendaFilter()` |
    `List<String>` | `getCompletedNodeIds()` |
    `String` | `getCorrelationKey()` |
    `int` | `getCurrentLevel()` |
    `String` | `getDeploymentId()` |
    `Function<String,​Object>` | `getEventFilterResolver​(org.kie.api.runtime.process.NodeInstanceContainer container, org.kie.api.definition.process.Node node, List<NodeInstance> currentView)` |
    `String[]` | `getEventTypes()` |
    `Object` | `getFaultData()` |
    `NodeInstance` | `getFirstNodeInstance​(long nodeId)` |
    `Map<String,​Integer>` | `getIterationLevels()` |
    `int` | `getLevelForNode​(String uniqueID)` |
    `org.kie.api.definition.process.NodeContainer` | `getNodeContainer()` |
    `NodeInstance` | `getNodeInstance​(long nodeInstanceId)` |
    `NodeInstance` | `getNodeInstance​(long nodeInstanceId, boolean recursive)` |
    `NodeInstance` | `getNodeInstance​(org.kie.api.definition.process.Node node)` |
    `NodeInstance` | `getNodeInstance​(org.kie.api.definition.process.Node node, boolean wrap)` |
    `NodeInstance` | `getNodeInstanceByNodeId​(long nodeId, boolean recursive)` |
    `long` | `getNodeInstanceCounter()` |
    `Collection<org.kie.api.runtime.process.NodeInstance>` | `getNodeInstances()` |
    `Collection<NodeInstance>` | `getNodeInstances​(boolean recursive)` |
    `List<NodeInstance>` | `getNodeInstances​(long nodeId)` |
    `List<NodeInstance>` | `getNodeInstances​(long nodeId, List<NodeInstance> currentView)` |
    `int` | `getSlaCompliance()` |
    `Date` | `getSlaDueDate()` |
    `Long` | `getSlaTimerId()` |
    `Date` | `getStartDate()` |
    `Object` | `getVariable​(String name)` |
    `Object` | `getVariable​(String name, List<ContextInstance> variableScopeInstances)` |
    `Map<String,​Object>` | `getVariables()` |
    `org.kie.api.definition.process.WorkflowProcess` | `getWorkflowProcess()` |
    `protected boolean` | `hasDeploymentId()` |
    `AtomicLong` | `internalGetNodeInstanceCounter()` |
    `void` | `internalSetNodeInstanceCounter​(long nodeInstanceCounter)` |
    `void` | `internalSetSlaCompliance​(int slaCompliance)` |
    `void` | `internalSetSlaDueDate​(Date slaDueDate)` |
    `void` | `internalSetSlaTimerId​(Long slaTimerId)` |
    `void` | `internalSetStartDate​(Date startDate)` |
    `boolean` | `isPersisted()` |
    `boolean` | `isSignalCompletion()` |
    `void` | `nodeInstanceCompleted​(NodeInstance nodeInstance, String outType)` |
    `void` | `reconnect()` |
    `protected void` | `registerExternalEventNodeListeners()` |
    `void` | `removeEventListener​(String type, org.kie.api.runtime.process.EventListener listener, boolean external)` |
    `void` | `removeNodeInstance​(NodeInstance nodeInstance)` |
    `protected List<String>` | `resolveVariables​(List<String> events)` |
    `void` | `setAgendaFilter​(org.kie.api.runtime.rule.AgendaFilter agendaFilter)` |
    `void` | `setCorrelationKey​(String correlationKey)` |
    `void` | `setCurrentLevel​(int currentLevel)` |
    `void` | `setDeploymentId​(String deploymentId)` |
    `void` | `setPersisted​(boolean persisted)` |
    `void` | `setSignalCompletion​(boolean signalCompletion)` |
    `void` | `setState​(int state)` |
    `void` | `setState​(int state, String outcome)` |
    `void` | `setState​(int state, String outcome, Object faultData)` |
    `void` | `setVariable​(String name, Object value)` |
    `void` | `signalEvent​(String type, Object event)` |
    `void` | `start()` |
    `void` | `start​(String trigger)` |
    `String` | `toString()` |
    `protected boolean` | `useAsync​(org.kie.api.definition.process.Node node)` |
    `protected boolean` | `useTimerSLATracking()` |

    - ### Methods inherited from class org.jbpm.process.instance.impl.ProcessInstanceImpl

      `addContextInstance, getAgenda, getContextContainer, getContextInstance, getContextInstance, getContextInstance, getContextInstances, getDescription, getId, getKnowledgeRuntime, getMetaData, getOutcome, getParentProcessInstanceId, getProcess, getProcessId, getProcessName, getProcessXml, getState, internalSetState, internalStart, removeContextInstance, setContextInstance, setDescription, setId, setKnowledgeRuntime, setMetaData, setOutcome, setParentProcessInstanceId, setProcess, setProcessId, setProcessXml, updateProcess`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.jbpm.process.instance.ContextableInstance

      `getContextInstance`

    - ### Methods inherited from interface org.jbpm.process.instance.ContextInstanceContainer

      `addContextInstance, getContextContainer, getContextInstance, getContextInstance, getContextInstances, removeContextInstance`

    - ### Methods inherited from interface org.jbpm.workflow.instance.NodeInstanceContainer

      `getState`

    - ### Methods inherited from interface org.jbpm.process.instance.ProcessInstance

      `getKnowledgeRuntime, getMetaData, getOutcome, getProcess, setId, setKnowledgeRuntime, setParentProcessInstanceId, setProcess`

    - ### Methods inherited from interface org.kie.api.runtime.process.ProcessInstance

      `getId, getParentProcessInstanceId, getProcessId, getProcessName, getState`

- - ### Constructor Detail

    - #### WorkflowProcessInstanceImpl

          public WorkflowProcessInstanceImpl()

  - ### Method Detail

    - #### getNodeContainer

          public org.kie.api.definition.process.NodeContainer getNodeContainer()

      Specified by:
        `getNodeContainer` in interface `NodeInstanceContainer`

    - #### addNodeInstance

          public void addNodeInstance​(NodeInstance nodeInstance)

      Specified by:
        `addNodeInstance` in interface `NodeInstanceContainer`

    - #### getLevelForNode

          public int getLevelForNode​(String uniqueID)

      Specified by:
        `getLevelForNode` in interface `NodeInstanceContainer`

    - #### removeNodeInstance

          public void removeNodeInstance​(NodeInstance nodeInstance)

      Specified by:
        `removeNodeInstance` in interface `NodeInstanceContainer`

    - #### getNodeInstances

          public Collection<org.kie.api.runtime.process.NodeInstance> getNodeInstances()

      Specified by:
        `getNodeInstances` in interface `org.kie.api.runtime.process.NodeInstanceContainer`

    - #### getNodeInstances

          public Collection<NodeInstance> getNodeInstances​(boolean recursive)

      Specified by:
        `getNodeInstances` in interface `NodeInstanceContainer`

    - #### getNodeInstance

          public NodeInstance getNodeInstance​(long nodeInstanceId)

      Specified by:
        `getNodeInstance` in interface `org.kie.api.runtime.process.NodeInstanceContainer`

    - #### getNodeInstanceByNodeId

          public NodeInstance getNodeInstanceByNodeId​(long nodeId,
                                                      boolean recursive)

    - #### getNodeInstance

          public NodeInstance getNodeInstance​(long nodeInstanceId,
                                              boolean recursive)

      Specified by:
        `getNodeInstance` in interface `NodeInstanceContainer`

    - #### getActiveNodeIds

          public List<String> getActiveNodeIds()

    - #### getFirstNodeInstance

          public NodeInstance getFirstNodeInstance​(long nodeId)

      Specified by:
        `getFirstNodeInstance` in interface `NodeInstanceContainer`

    - #### getNodeInstances

          public List<NodeInstance> getNodeInstances​(long nodeId)

    - #### getNodeInstances

          public List<NodeInstance> getNodeInstances​(long nodeId,
                                                     List<NodeInstance> currentView)

    - #### getNodeInstance

          public NodeInstance getNodeInstance​(org.kie.api.definition.process.Node node)

      Specified by:
        `getNodeInstance` in interface `NodeInstanceContainer`

    - #### getNodeInstance

          public NodeInstance getNodeInstance​(org.kie.api.definition.process.Node node,
                                              boolean wrap)

    - #### getNodeInstanceCounter

          public long getNodeInstanceCounter()

    - #### internalSetNodeInstanceCounter

          public void internalSetNodeInstanceCounter​(long nodeInstanceCounter)

    - #### internalGetNodeInstanceCounter

          public AtomicLong internalGetNodeInstanceCounter()

    - #### getWorkflowProcess

          public org.kie.api.definition.process.WorkflowProcess getWorkflowProcess()

    - #### getVariable

          public Object getVariable​(String name)

      Specified by:
        `getVariable` in interface `org.kie.api.runtime.process.WorkflowProcessInstance`

    - #### getVariable

          public Object getVariable​(String name,
                                    List<ContextInstance> variableScopeInstances)

    - #### getVariables

          public Map<String,​Object> getVariables()

    - #### setVariable

          public void setVariable​(String name,
                                  Object value)

      Specified by:
        `setVariable` in interface `org.kie.api.runtime.process.WorkflowProcessInstance`

    - #### setState

          public void setState​(int state,
                               String outcome,
                               Object faultData)

      Specified by:
        `setState` in interface `ProcessInstance`

    - #### setState

          public void setState​(int state,
                               String outcome)

      Specified by:
        `setState` in interface `ProcessInstance`
      Overrides:
        `setState` in class `ProcessInstanceImpl`

    - #### setState

          public void setState​(int state)

      Specified by:
        `setState` in interface `NodeInstanceContainer`
      Specified by:
        `setState` in interface `ProcessInstance`
      Overrides:
        `setState` in class `ProcessInstanceImpl`

    - #### disconnect

          public void disconnect()

      Overrides:
        `disconnect` in class `ProcessInstanceImpl`

    - #### reconnect

          public void reconnect()

      Overrides:
        `reconnect` in class `ProcessInstanceImpl`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `ProcessInstanceImpl`

    - #### start

          public void start()

      Specified by:
        `start` in interface `ProcessInstance`
      Overrides:
        `start` in class `ProcessInstanceImpl`

    - #### start

          public void start​(String trigger)

      Specified by:
        `start` in interface `ProcessInstance`
      Overrides:
        `start` in class `ProcessInstanceImpl`

    - #### configureSLA

          public void configureSLA()

      Specified by:
        `configureSLA` in interface `ProcessInstance`

    - #### configureSLATimer

          public TimerInstance configureSLATimer​(String slaDueDateExpression)

    - #### configureSLATimer

          public TimerInstance configureSLATimer​(String slaDueDateExpression,
                                                 String timerName)

    - #### registerExternalEventNodeListeners

          protected void registerExternalEventNodeListeners()

    - #### signalEvent

          public void signalEvent​(String type,
                                  Object event)

      Specified by:
        `signalEvent` in interface `org.kie.api.runtime.process.EventListener`
      Overrides:
        `signalEvent` in class `ProcessInstanceImpl`

    - #### getEventFilterResolver

          public Function<String,​Object> getEventFilterResolver​(org.kie.api.runtime.process.NodeInstanceContainer container,
                                                                      org.kie.api.definition.process.Node node,
                                                                      List<NodeInstance> currentView)

    - #### resolveVariables

          protected List<String> resolveVariables​(List<String> events)

    - #### addEventListener

          public void addEventListener​(String type,
                                       org.kie.api.runtime.process.EventListener listener,
                                       boolean external)

      Specified by:
        `addEventListener` in interface `WorkflowProcessInstance`

    - #### removeEventListener

          public void removeEventListener​(String type,
                                          org.kie.api.runtime.process.EventListener listener,
                                          boolean external)

      Specified by:
        `removeEventListener` in interface `WorkflowProcessInstance`

    - #### getEventTypes

          public String[] getEventTypes()

      Specified by:
        `getEventTypes` in interface `org.kie.api.runtime.process.EventListener`
      Overrides:
        `getEventTypes` in class `ProcessInstanceImpl`

    - #### nodeInstanceCompleted

          public void nodeInstanceCompleted​(NodeInstance nodeInstance,
                                            String outType)

      Specified by:
        `nodeInstanceCompleted` in interface `NodeInstanceContainer`

    - #### addCompletedNodeId

          public void addCompletedNodeId​(String uniqueId)

    - #### getCompletedNodeIds

          public List<String> getCompletedNodeIds()

    - #### getCurrentLevel

          public int getCurrentLevel()

      Specified by:
        `getCurrentLevel` in interface `NodeInstanceContainer`

    - #### setCurrentLevel

          public void setCurrentLevel​(int currentLevel)

      Specified by:
        `setCurrentLevel` in interface `NodeInstanceContainer`

    - #### getIterationLevels

          public Map<String,​Integer> getIterationLevels()

    - #### isPersisted

          public boolean isPersisted()

    - #### setPersisted

          public void setPersisted​(boolean persisted)

    - #### addActivatingNodeId

          public void addActivatingNodeId​(String uniqueId)

    - #### getActivatingNodeIds

          public List<String> getActivatingNodeIds()

    - #### getFaultData

          public Object getFaultData()

      Specified by:
        `getFaultData` in interface `ProcessInstance`

    - #### isSignalCompletion

          public boolean isSignalCompletion()

      Specified by:
        `isSignalCompletion` in interface `ProcessInstance`

    - #### setSignalCompletion

          public void setSignalCompletion​(boolean signalCompletion)

      Specified by:
        `setSignalCompletion` in interface `ProcessInstance`

    - #### getDeploymentId

          public String getDeploymentId()

      Specified by:
        `getDeploymentId` in interface `ProcessInstance`

    - #### setDeploymentId

          public void setDeploymentId​(String deploymentId)

      Specified by:
        `setDeploymentId` in interface `ProcessInstance`

    - #### getCorrelationKey

          public String getCorrelationKey()

    - #### setCorrelationKey

          public void setCorrelationKey​(String correlationKey)

    - #### getStartDate

          public Date getStartDate()

      Specified by:
        `getStartDate` in interface `ProcessInstance`

    - #### internalSetStartDate

          public void internalSetStartDate​(Date startDate)

    - #### hasDeploymentId

          protected boolean hasDeploymentId()

    - #### useAsync

          protected boolean useAsync​(org.kie.api.definition.process.Node node)

    - #### useTimerSLATracking

          protected boolean useTimerSLATracking()

    - #### getSlaCompliance

          public int getSlaCompliance()

      Specified by:
        `getSlaCompliance` in interface `ProcessInstance`

    - #### internalSetSlaCompliance

          public void internalSetSlaCompliance​(int slaCompliance)

    - #### getSlaDueDate

          public Date getSlaDueDate()

      Specified by:
        `getSlaDueDate` in interface `ProcessInstance`

    - #### internalSetSlaDueDate

          public void internalSetSlaDueDate​(Date slaDueDate)

    - #### getSlaTimerId

          public Long getSlaTimerId()

    - #### internalSetSlaTimerId

          public void internalSetSlaTimerId​(Long slaTimerId)

    - #### getAgendaFilter

          public org.kie.api.runtime.rule.AgendaFilter getAgendaFilter()

      Specified by:
        `getAgendaFilter` in interface `ProcessInstance`

    - #### setAgendaFilter

          public void setAgendaFilter​(org.kie.api.runtime.rule.AgendaFilter agendaFilter)

      Specified by:
        `setAgendaFilter` in interface `ProcessInstance`