org.jbpm.kie.services.impl

## Class ProcessServiceImpl

- java.lang.Object
- - org.jbpm.kie.services.impl.ProcessServiceImpl

- All Implemented Interfaces:
    VariablesAware, ProcessService
  Direct Known Subclasses:
    ProcessServiceCDIImpl, ProcessServiceEJBImpl

      public class ProcessServiceImpl
      extends Object
      implements ProcessService, VariablesAware

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected RuntimeDataService` | `dataService`
    `protected DeploymentService` | `deploymentService`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProcessServiceImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `abortProcessInstance(Long processInstanceId)` Aborts the specified process
    `void` | `abortProcessInstance(String deploymentId, Long processInstanceId)` Aborts the specified process
    `void` | `abortProcessInstances(List<Long> processInstanceIds)` Aborts all specified processes
    `void` | `abortProcessInstances(String deploymentId, List<Long> processInstanceIds)` Aborts all specified processes
    `void` | `abortWorkItem(Long id)` Abort the specified workItem
    `void` | `abortWorkItem(String deploymentId, Long processInstanceId, Long id)` Abort the specified workItem
    `protected Collection<String>` | `collectActiveSignals(Collection<org.kie.api.runtime.process.NodeInstance> activeNodes)`
    `void` | `completeWorkItem(Long id, Map<String,Object> results)` Completes the specified WorkItem with the given results
    `void` | `completeWorkItem(String deploymentId, Long processInstanceId, Long id, Map<String,Object> results)` Completes the specified WorkItem with the given results
    `protected void` | `disallowWhenNotActive(DeployedUnit deployedUnit, org.kie.api.command.Command<?> cmd)`
    `protected void` | `disposeRuntimeEngine(org.kie.api.runtime.manager.RuntimeManager manager, org.kie.api.runtime.manager.RuntimeEngine engine)`
    `<T> T` | `execute(String deploymentId, org.kie.api.command.Command<T> command)` Executes provided command on the underlying command executor (usually KieSession)
    `<T> T` | `execute(String deploymentId, org.kie.api.runtime.manager.Context<?> context, org.kie.api.command.Command<T> command)` Executes provided command on the underlying command executor (usually KieSession)
    `protected List<String>` | `getActiveBoundaryNodesSignals(org.kie.api.runtime.process.ProcessInstance processInstance, Collection<org.kie.api.runtime.process.NodeInstance> activeNodes)`
    `Collection<String>` | `getAvailableSignals(Long processInstanceId)` Returns all signals available in current state of given process instance
    `Collection<String>` | `getAvailableSignals(String deploymentId, Long processInstanceId)` Returns all signals available in current state of given process instance
    `protected org.kie.api.runtime.manager.Context<?>` | `getContext(Map<String,Object> params)`
    `org.kie.api.runtime.process.ProcessInstance` | `getProcessInstance(org.kie.internal.process.CorrelationKey key)` Returns process instance information.
    `org.kie.api.runtime.process.ProcessInstance` | `getProcessInstance(Long processInstanceId)` Returns process instance information.
    `org.kie.api.runtime.process.ProcessInstance` | `getProcessInstance(String deploymentId, org.kie.internal.process.CorrelationKey key)` Returns process instance information.
    `org.kie.api.runtime.process.ProcessInstance` | `getProcessInstance(String deploymentId, Long processInstanceId)` Returns process instance information.
    `Object` | `getProcessInstanceVariable(Long processInstanceId, String variableName)` Gets a process instance's variable.
    `Object` | `getProcessInstanceVariable(String deploymentId, Long processInstanceId, String variableName)` Gets a process instance's variable.
    `Map<String,Object>` | `getProcessInstanceVariables(Long processInstanceId)` Gets a process instance's variable values.
    `Map<String,Object>` | `getProcessInstanceVariables(String deploymentId, Long processInstanceId)` Gets a process instance's variable values.
    `org.kie.api.runtime.process.WorkItem` | `getWorkItem(Long id)` Returns the specified workItem
    `org.kie.api.runtime.process.WorkItem` | `getWorkItem(String deploymentId, Long processInstanceId, Long id)` Returns the specified workItem
    `List<org.kie.api.runtime.process.WorkItem>` | `getWorkItemByProcessInstance(Long processInstanceId)` Returns active work items by process instance id.
    `List<org.kie.api.runtime.process.WorkItem>` | `getWorkItemByProcessInstance(String deploymentId, Long processInstanceId)` Returns active work items by process instance id.
    `<T> T` | `process(T variables, ClassLoader cl)` Generic processing method that might be simply returning same instance of variables if no processing is required.
    `void` | `setDataService(RuntimeDataService dataService)`
    `void` | `setDeploymentService(DeploymentService deploymentService)`
    `void` | `setProcessVariable(Long processInstanceId, String variableId, Object value)` Sets a process variable.
    `void` | `setProcessVariable(String deploymentId, Long processInstanceId, String variableId, Object value)` Sets a process variable.
    `void` | `setProcessVariables(Long processInstanceId, Map<String,Object> variables)` Sets process variables.
    `void` | `setProcessVariables(String deploymentId, Long processInstanceId, Map<String,Object> variables)` Sets process variables.
    `void` | `signalEvent(String deploymentId, String signalName, Object event)` Signal an event to a any process instance that listens to give signal that belongs to given deployment
    `void` | `signalProcessInstance(Long processInstanceId, String signalName, Object event)` Signal an event to a single process instance
    `void` | `signalProcessInstance(String deploymentId, Long processInstanceId, String signalName, Object event)` Signal an event to a single process instance
    `void` | `signalProcessInstances(List<Long> processInstanceIds, String signalName, Object event)` Signal an event to given list of process instances
    `void` | `signalProcessInstances(String deploymentId, List<Long> processInstanceIds, String signalName, Object event)` Signal an event to given list of process instances
    `Long` | `startProcess(String deploymentId, String processId)` Starts a process with no variables
    `Long` | `startProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey)` Starts a process with no variables
    `Long` | `startProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> params)` Starts a process with no variables
    `Long` | `startProcess(String deploymentId, String processId, Map<String,Object> params)` Starts a process with no variables

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

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

- - ### Field Detail

    - #### deploymentService

          protected DeploymentService deploymentService

    - #### dataService

          protected RuntimeDataService dataService

  - ### Constructor Detail

    - #### ProcessServiceImpl

          public ProcessServiceImpl()

  - ### Method Detail

    - #### setDeploymentService

          public void setDeploymentService(DeploymentService deploymentService)

    - #### setDataService

          public void setDataService(RuntimeDataService dataService)

    - #### startProcess

          public Long startProcess(String deploymentId,
                                   String processId)

      Description copied from interface: `ProcessService`
      Starts a process with no variables
      Specified by:
        `startProcess` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `processId` - The process's identifier
      Returns:
        process instance identifier

    - #### startProcess

          public Long startProcess(String deploymentId,
                                   String processId,
                                   Map<String,Object> params)

      Description copied from interface: `ProcessService`
      Starts a process with no variables
      Specified by:
        `startProcess` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `processId` - The process's identifier
        `params` - process variables
      Returns:
        process instance identifier

    - #### startProcess

          public Long startProcess(String deploymentId,
                                   String processId,
                                   org.kie.internal.process.CorrelationKey correlationKey)

      Description copied from interface: `ProcessService`
      Starts a process with no variables
      Specified by:
        `startProcess` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `processId` - The process's identifier
        `correlationKey` - correlation key to be assigned to process instance - must be unique
      Returns:
        process instance identifier

    - #### startProcess

          public Long startProcess(String deploymentId,
                                   String processId,
                                   org.kie.internal.process.CorrelationKey correlationKey,
                                   Map<String,Object> params)

      Description copied from interface: `ProcessService`
      Starts a process with no variables
      Specified by:
        `startProcess` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `processId` - The process's identifier
        `correlationKey` - correlation key to be assigned to process instance - must be unique
        `params` - process variables
      Returns:
        process instance identifier

    - #### getContext

          protected org.kie.api.runtime.manager.Context<?> getContext(Map<String,Object> params)

    - #### abortProcessInstance

          public void abortProcessInstance(Long processInstanceId)

      Description copied from interface: `ProcessService`
      Aborts the specified process
      Specified by:
        `abortProcessInstance` in interface `ProcessService`
      Parameters:
        `processInstanceId` - process instance's unique identifier

    - #### abortProcessInstance

          public void abortProcessInstance(String deploymentId,
                                           Long processInstanceId)

      Description copied from interface: `ProcessService`
      Aborts the specified process
      Specified by:
        `abortProcessInstance` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - process instance's unique identifier

    - #### abortProcessInstances

          public void abortProcessInstances(List<Long> processInstanceIds)

      Description copied from interface: `ProcessService`
      Aborts all specified processes
      Specified by:
        `abortProcessInstances` in interface `ProcessService`
      Parameters:
        `processInstanceIds` - list of process instance unique identifiers

    - #### abortProcessInstances

          public void abortProcessInstances(String deploymentId,
                                            List<Long> processInstanceIds)

      Description copied from interface: `ProcessService`
      Aborts all specified processes
      Specified by:
        `abortProcessInstances` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceIds` - list of process instance unique identifiers

    - #### signalProcessInstance

          public void signalProcessInstance(Long processInstanceId,
                                            String signalName,
                                            Object event)

      Description copied from interface: `ProcessService`
      Signal an event to a single process instance
      Specified by:
        `signalProcessInstance` in interface `ProcessService`
      Parameters:
        `processInstanceId` - the process instance's unique identifier
        `signalName` - the signal's id in the process
        `event` - the event object to be passed in with the event

    - #### signalProcessInstance

          public void signalProcessInstance(String deploymentId,
                                            Long processInstanceId,
                                            String signalName,
                                            Object event)

      Description copied from interface: `ProcessService`
      Signal an event to a single process instance
      Specified by:
        `signalProcessInstance` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - the process instance's unique identifier
        `signalName` - the signal's id in the process
        `event` - the event object to be passed in with the event

    - #### signalProcessInstances

          public void signalProcessInstances(List<Long> processInstanceIds,
                                             String signalName,
                                             Object event)

      Description copied from interface: `ProcessService`
      Signal an event to given list of process instances
      Specified by:
        `signalProcessInstances` in interface `ProcessService`
      Parameters:
        `processInstanceIds` - list of process instance unique identifiers
        `signalName` - the signal's id in the process
        `event` - the event object to be passed in with the event

    - #### signalProcessInstances

          public void signalProcessInstances(String deploymentId,
                                             List<Long> processInstanceIds,
                                             String signalName,
                                             Object event)

      Description copied from interface: `ProcessService`
      Signal an event to given list of process instances
      Specified by:
        `signalProcessInstances` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceIds` - list of process instance unique identifiers
        `signalName` - the signal's id in the process
        `event` - the event object to be passed in with the event

    - #### signalEvent

          public void signalEvent(String deploymentId,
                                  String signalName,
                                  Object event)

      Description copied from interface: `ProcessService`
      Signal an event to a any process instance that listens to give signal that belongs to given deployment
      Specified by:
        `signalEvent` in interface `ProcessService`
      Parameters:
        `deploymentId` - information for the process's kjar
        `signalName` - the signal's id in the process
        `event` - the event object to be passed in with the event

    - #### getProcessInstance

          public org.kie.api.runtime.process.ProcessInstance getProcessInstance(Long processInstanceId)

      Description copied from interface: `ProcessService`
      Returns process instance information. Will return null if no active process with that id is found
      Specified by:
        `getProcessInstance` in interface `ProcessService`
      Parameters:
        `processInstanceId` - The process instance's unique identifier
      Returns:
        Process instance information

    - #### getProcessInstance

          public org.kie.api.runtime.process.ProcessInstance getProcessInstance(String deploymentId,
                                                                                Long processInstanceId)

      Description copied from interface: `ProcessService`
      Returns process instance information. Will return null if no active process with that id is found
      Specified by:
        `getProcessInstance` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - The process instance's unique identifier
      Returns:
        Process instance information

    - #### getProcessInstance

          public org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey key)

      Description copied from interface: `ProcessService`
      Returns process instance information. Will return null if no active process with that correlation key is found
      Specified by:
        `getProcessInstance` in interface `ProcessService`
      Parameters:
        `key` - correlation key assigned to process instance
      Returns:
        Process instance information

    - #### getProcessInstance

          public org.kie.api.runtime.process.ProcessInstance getProcessInstance(String deploymentId,
                                                                                org.kie.internal.process.CorrelationKey key)

      Description copied from interface: `ProcessService`
      Returns process instance information. Will return null if no active process with that correlation key is found
      Specified by:
        `getProcessInstance` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `key` - correlation key assigned to process instance
      Returns:
        Process instance information

    - #### setProcessVariable

          public void setProcessVariable(Long processInstanceId,
                                         String variableId,
                                         Object value)

      Description copied from interface: `ProcessService`
      Sets a process variable.
      Specified by:
        `setProcessVariable` in interface `ProcessService`
      Parameters:
        `processInstanceId` - The process instance's unique identifier.
        `variableId` - The variable id to set.
        `value` - The variable value.

    - #### setProcessVariable

          public void setProcessVariable(String deploymentId,
                                         Long processInstanceId,
                                         String variableId,
                                         Object value)

      Description copied from interface: `ProcessService`
      Sets a process variable.
      Specified by:
        `setProcessVariable` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - The process instance's unique identifier.
        `variableId` - The variable id to set.
        `value` - The variable value.

    - #### setProcessVariables

          public void setProcessVariables(Long processInstanceId,
                                          Map<String,Object> variables)

      Description copied from interface: `ProcessService`
      Sets process variables.
      Specified by:
        `setProcessVariables` in interface `ProcessService`
      Parameters:
        `processInstanceId` - The process instance's unique identifier.
        `variables` - map of process variables (key - variable name, value - variable value)

    - #### setProcessVariables

          public void setProcessVariables(String deploymentId,
                                          Long processInstanceId,
                                          Map<String,Object> variables)

      Description copied from interface: `ProcessService`
      Sets process variables.
      Specified by:
        `setProcessVariables` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - The process instance's unique identifier.
        `variables` - map of process variables (key - variable name, value - variable value)

    - #### getProcessInstanceVariable

          public Object getProcessInstanceVariable(Long processInstanceId,
                                                   String variableName)

      Description copied from interface: `ProcessService`
      Gets a process instance's variable.
      Specified by:
        `getProcessInstanceVariable` in interface `ProcessService`
      Parameters:
        `processInstanceId` - the process instance's unique identifier.
        `variableName` - the variable name to get from the process.

    - #### getProcessInstanceVariable

          public Object getProcessInstanceVariable(String deploymentId,
                                                   Long processInstanceId,
                                                   String variableName)

      Description copied from interface: `ProcessService`
      Gets a process instance's variable.
      Specified by:
        `getProcessInstanceVariable` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - the process instance's unique identifier.
        `variableName` - the variable name to get from the process.

    - #### getProcessInstanceVariables

          public Map<String,Object> getProcessInstanceVariables(Long processInstanceId)

      Description copied from interface: `ProcessService`
      Gets a process instance's variable values.
      Specified by:
        `getProcessInstanceVariables` in interface `ProcessService`
      Parameters:
        `processInstanceId` - The process instance's unique identifier.

    - #### getProcessInstanceVariables

          public Map<String,Object> getProcessInstanceVariables(String deploymentId,
                                                                Long processInstanceId)

      Description copied from interface: `ProcessService`
      Gets a process instance's variable values.
      Specified by:
        `getProcessInstanceVariables` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - The process instance's unique identifier.

    - #### getAvailableSignals

          public Collection<String> getAvailableSignals(Long processInstanceId)

      Description copied from interface: `ProcessService`
      Returns all signals available in current state of given process instance
      Specified by:
        `getAvailableSignals` in interface `ProcessService`
      Parameters:
        `processInstanceId` - process instance id
      Returns:
        list of available signals or empty list if no signals are available

    - #### getAvailableSignals

          public Collection<String> getAvailableSignals(String deploymentId,
                                                        Long processInstanceId)

      Description copied from interface: `ProcessService`
      Returns all signals available in current state of given process instance
      Specified by:
        `getAvailableSignals` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - process instance id
      Returns:
        list of available signals or empty list if no signals are available

    - #### completeWorkItem

          public void completeWorkItem(Long id,
                                       Map<String,Object> results)

      Description copied from interface: `ProcessService`
      Completes the specified WorkItem with the given results
      Specified by:
        `completeWorkItem` in interface `ProcessService`
      Parameters:
        `id` - workItem id
        `results` - results of the workItem

    - #### completeWorkItem

          public void completeWorkItem(String deploymentId,
                                       Long processInstanceId,
                                       Long id,
                                       Map<String,Object> results)

      Description copied from interface: `ProcessService`
      Completes the specified WorkItem with the given results
      Specified by:
        `completeWorkItem` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - process instance id that work item belongs to
        `id` - workItem id
        `results` - results of the workItem

    - #### abortWorkItem

          public void abortWorkItem(Long id)

      Description copied from interface: `ProcessService`
      Abort the specified workItem
      Specified by:
        `abortWorkItem` in interface `ProcessService`
      Parameters:
        `id` - workItem id

    - #### abortWorkItem

          public void abortWorkItem(String deploymentId,
                                    Long processInstanceId,
                                    Long id)

      Description copied from interface: `ProcessService`
      Abort the specified workItem
      Specified by:
        `abortWorkItem` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - process instance id that work item belongs to
        `id` - workItem id

    - #### getWorkItem

          public org.kie.api.runtime.process.WorkItem getWorkItem(Long id)

      Description copied from interface: `ProcessService`
      Returns the specified workItem
      Specified by:
        `getWorkItem` in interface `ProcessService`
      Parameters:
        `id` - workItem id
      Returns:
        The specified workItem

    - #### getWorkItem

          public org.kie.api.runtime.process.WorkItem getWorkItem(String deploymentId,
                                                                  Long processInstanceId,
                                                                  Long id)

      Description copied from interface: `ProcessService`
      Returns the specified workItem
      Specified by:
        `getWorkItem` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - process instance id that work item belongs to
        `id` - workItem id
      Returns:
        The specified workItem

    - #### getWorkItemByProcessInstance

          public List<org.kie.api.runtime.process.WorkItem> getWorkItemByProcessInstance(Long processInstanceId)

      Description copied from interface: `ProcessService`
      Returns active work items by process instance id.
      Specified by:
        `getWorkItemByProcessInstance` in interface `ProcessService`
      Parameters:
        `processInstanceId` - process instance id
      Returns:
        The list of active workItems for the process instance

    - #### getWorkItemByProcessInstance

          public List<org.kie.api.runtime.process.WorkItem> getWorkItemByProcessInstance(String deploymentId,
                                                                                         Long processInstanceId)

      Description copied from interface: `ProcessService`
      Returns active work items by process instance id.
      Specified by:
        `getWorkItemByProcessInstance` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment that process instance belongs to
        `processInstanceId` - process instance id
      Returns:
        The list of active workItems for the process instance

    - #### execute

          public <T> T execute(String deploymentId,
                               org.kie.api.command.Command<T> command)

      Description copied from interface: `ProcessService`
      Executes provided command on the underlying command executor (usually KieSession)
      Specified by:
        `execute` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `command` - actual command for execution
      Returns:
        results of command execution

    - #### execute

          public <T> T execute(String deploymentId,
                               org.kie.api.runtime.manager.Context<?> context,
                               org.kie.api.command.Command<T> command)

      Description copied from interface: `ProcessService`
      Executes provided command on the underlying command executor (usually KieSession)
      Specified by:
        `execute` in interface `ProcessService`
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `context` - context implementation to be used to get runtime engine
        `command` - actual command for execution
      Returns:
        results of command execution

    - #### disallowWhenNotActive

          protected void disallowWhenNotActive(DeployedUnit deployedUnit,
                                               org.kie.api.command.Command<?> cmd)

    - #### collectActiveSignals

          protected Collection<String> collectActiveSignals(Collection<org.kie.api.runtime.process.NodeInstance> activeNodes)

    - #### getActiveBoundaryNodesSignals

          protected List<String> getActiveBoundaryNodesSignals(org.kie.api.runtime.process.ProcessInstance processInstance,
                                                               Collection<org.kie.api.runtime.process.NodeInstance> activeNodes)

    - #### process

          public <T> T process(T variables,
                               ClassLoader cl)

      Description copied from interface: `VariablesAware`
      Generic processing method that might be simply returning same instance of variables if no processing is required.
      Specified by:
        `process` in interface `VariablesAware`
      Parameters:
        `variables` - object that holds varialble(s)
        `cl` - classloader that shall be used to operate on the variables e.g. project class loader
      Returns:

    - #### disposeRuntimeEngine

          protected void disposeRuntimeEngine(org.kie.api.runtime.manager.RuntimeManager manager,
                                              org.kie.api.runtime.manager.RuntimeEngine engine)

Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.