Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.2.0.CR2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jbpm.services.api
Interface ProcessService

All Known Subinterfaces:
  ProcessServiceEJBLocal, ProcessServiceEJBRemote

All Known Implementing Classes:
  ProcessServiceCDIImpl, ProcessServiceEJBImpl, ProcessServiceImpl

    public interface ProcessService

Method Summary
`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, Command<T> command)` Executes provided command on the underlying command executor (usually KieSession)
`
`<T> T`
` | `execute(String deploymentId, Context<?> context, 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
`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.
`WorkItem` | `getWorkItem(Long id)` Returns the specified workItem
`List<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` | `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, 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

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

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

### getProcessInstance

    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

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

    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<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,
                  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 unit was not found

### execute

    <T> T execute(String deploymentId,
                  Context<?> context,
                  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 unit was not found

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.2.0.CR2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.