org.jbpm.services.api

## Interface ProcessService

- All Known Subinterfaces:
    ProcessServiceEJBLocal, ProcessServiceEJBRemote
  All Known Implementing Classes:
    ProcessServiceCDIImpl, ProcessServiceEJBImpl, ProcessServiceImpl

      public interface ProcessService

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `abortProcessInstance(Long processInstanceId)` Aborts the specified process
    `void` | `abortProcessInstances(List<Long> processInstanceIds)` Aborts all specified processes
    `void` | `abortWorkItem(Long id)` Abort the specified workItem
    `void` | `completeWorkItem(Long id, Map<String,Object> results)` Completes the specified WorkItem with the given results
    `<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)
    `Collection<String>` | `getAvailableSignals(Long processInstanceId)` Returns all signals available in current state of given process instance
    `org.kie.api.runtime.process.ProcessInstance` | `getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)` Returns process instance information.
    `org.kie.api.runtime.process.ProcessInstance` | `getProcessInstance(Long processInstanceId)` Returns process instance information.
    `Object` | `getProcessInstanceVariable(Long processInstanceId, String variableName)` Gets a process instance's variable.
    `Map<String,Object>` | `getProcessInstanceVariables(Long processInstanceId)` Gets a process instance's variable values.
    `org.kie.api.runtime.process.WorkItem` | `getWorkItem(Long id)` Returns the specified workItem
    `List<org.kie.api.runtime.process.WorkItem>` | `getWorkItemByProcessInstance(Long processInstanceId)` Returns active work items by process instance id.
    `void` | `setProcessVariable(Long processInstanceId, String variableId, Object value)` Sets a process variable.
    `void` | `setProcessVariables(Long processInstanceId, Map<String,Object> variables)` Sets process variables.
    `void` | `signalEvent(String deployment, 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` | `signalProcessInstances(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

- - ### Method Detail

    - #### startProcess

          Long startProcess(String deploymentId,
                          String processId)

      Starts a process with no variables
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `processId` - The process's identifier
      Returns:
        process instance identifier
      Throws:
        `RuntimeException` - in case of encountered errors
        `DeploymentNotFoundException` - in case deployment with given deployment id does not exist or is not active

    - #### startProcess

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

      Starts a process with no variables
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `processId` - The process's identifier
        `params` - process variables
      Returns:
        process instance identifier
      Throws:
        `RuntimeException` - in case of encountered errors
        `DeploymentNotFoundException` - in case deployment with given deployment id does not exist or is not active

    - #### startProcess

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

      Starts a process with no variables
      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
      Throws:
        `RuntimeException` - in case of encountered errors
        `DeploymentNotFoundException` - in case deployment with given deployment id does not exist or is not active

    - #### startProcess

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

      Starts a process with no variables
      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
      Throws:
        `RuntimeException` - in case of encountered errors
        `DeploymentNotFoundException` - in case deployment with given deployment id does not exist or is not active

    - #### abortProcessInstance

          void abortProcessInstance(Long processInstanceId)

      Aborts the specified process
      Parameters:
        `processInstanceId` - process instance's unique identifier
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### abortProcessInstances

          void abortProcessInstances(List<Long> processInstanceIds)

      Aborts all specified processes
      Parameters:
        `processInstanceIds` - list of process instance unique identifiers
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### signalProcessInstance

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

      Signal an event to a single process instance
      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
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### signalProcessInstances

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

      Signal an event to given list of process instances
      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
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### signalEvent

          void signalEvent(String deployment,
                         String signalName,
                         Object event)

      Signal an event to a any process instance that listens to give signal that belongs to given deployment
      Parameters:
        `deployment` - 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
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found

    - #### getProcessInstance

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

      Returns process instance information. Will return null if no active process with that id is found
      Parameters:
        `processInstanceId` - The process instance's unique identifier
      Returns:
        Process instance information
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found

    - #### getProcessInstance

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

      Returns process instance information. Will return null if no active process with that correlation key is found
      Parameters:
        `correlationKey` - correlation key assigned to process instance
      Returns:
        Process instance information
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found

    - #### setProcessVariable

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

      Sets a process variable.
      Parameters:
        `processInstanceId` - The process instance's unique identifier.
        `variableName` - The variable name to set.
        `variable` - The variable value.
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### setProcessVariables

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

      Sets process variables.
      Parameters:
        `processInstanceId` - The process instance's unique identifier.
        `variables` - map of process variables (key - variable name, value - variable value)
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### getProcessInstanceVariable

          Object getProcessInstanceVariable(Long processInstanceId,
                                          String variableName)

      Gets a process instance's variable.
      Parameters:
        `processInstanceId` - the process instance's unique identifier.
        `variableName` - the variable name to get from the process.
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### getProcessInstanceVariables

          Map<String,Object> getProcessInstanceVariables(Long processInstanceId)

      Gets a process instance's variable values.
      Parameters:
        `processInstanceId` - The process instance's unique identifier.
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### getAvailableSignals

          Collection<String> getAvailableSignals(Long processInstanceId)

      Returns all signals available in current state of given process instance
      Parameters:
        `processInstanceId` - process instance id
      Returns:
        list of available signals or empty list if no signals are available

    - #### completeWorkItem

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

      Completes the specified WorkItem with the given results
      Parameters:
        `id` - workItem id
        `results` - results of the workItem
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `WorkItemNotFoundException` - in case work item with given id was not found

    - #### abortWorkItem

          void abortWorkItem(Long id)

      Abort the specified workItem
      Parameters:
        `id` - workItem id
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `WorkItemNotFoundException` - in case work item with given id was not found

    - #### getWorkItem

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

      Returns the specified workItem
      Parameters:
        `id` - workItem id
      Returns:
        The specified workItem
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `WorkItemNotFoundException` - in case work item with given id was not found

    - #### getWorkItemByProcessInstance

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

      Returns active work items by process instance id.
      Parameters:
        `processInstanceId` - process instance id
      Returns:
        The list of active workItems for the process instance
      Throws:
        `DeploymentNotFoundException` - in case deployment unit was not found
        `ProcessInstanceNotFoundException` - in case process instance with given id was not found

    - #### execute

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

      Executes provided command on the underlying command executor (usually KieSession)
      Parameters:
        `deploymentId` - deployment information for the process's kjar
        `command` - actual command for execution
      Returns:
        results of command execution
      Throws:
        `DeploymentNotFoundException` - in case deployment with given deployment id does not exist or is not active for restricted commands (e.g. start process)

    - #### execute

          <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)
      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
      Throws:
        `DeploymentNotFoundException` - in case deployment with given deployment id does not exist or is not active for restricted commands (e.g. start process)

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