org.jbpm
Interface ExecutionService

All Superinterfaces:
ExecutionReadService, Service

public interface ExecutionService
extends ExecutionReadService

allows clients to manage the execution of business processes.


Method Summary
 InvocationLog cancelProcessInstance(java.lang.Long processInstanceId)
          cancels the complete process instance.
 InvocationLog cancelToken(java.lang.Long flowId)
          cancels one flow in a process instance.
 InvocationLog endOfState(java.lang.Long tokenId)
          will cause the engine to calculate the next state.
 InvocationLog endOfState(java.lang.Long tokenId, java.util.Map variables)
          will cause the engine to calculate the next state.
 InvocationLog endOfState(java.lang.Long tokenId, java.util.Map variables, java.lang.String transitionName)
          will cause the engine to calculate the next state.
 InvocationLog reassign(java.lang.Long tokenId, java.lang.String newActorId)
          reassigns the current activity of the given flow to the new actor.
 InvocationLog setVariables(java.lang.Long tokenId, java.util.Map variables)
          stores the variables without signalling an end-of-state.
 InvocationLog startProcessInstance(java.lang.Long definitionId)
          creates a new process instance for the given process definition.
 InvocationLog startProcessInstance(java.lang.Long definitionId, java.util.Map variables)
          creates a new process instance for the given process definition.
 InvocationLog startProcessInstance(java.lang.Long definitionId, java.util.Map variables, java.lang.String transitionName)
          creates a new process instance for the given process definition.
 InvocationLog startProcessInstance(java.lang.String definitionName)
          creates a new process instance for the latest version of the given process definition.
 InvocationLog startProcessInstance(java.lang.String definitionName, java.util.Map variables)
          creates a new process instance for the latest version of the given process definition.
 InvocationLog startProcessInstance(java.lang.String definitionName, java.util.Map variables, java.lang.String transitionName)
          creates a new process instance for the latest version of the given process definition.
 InvocationLog undo(java.lang.Long processInstanceId, java.util.Date date)
          brings the process instance back in the state it was at the given time.
 
Methods inherited from interface org.jbpm.ExecutionReadService
findActiveTokensInState, findActiveTokensInState, findByQuery, getAllDefinitions, getAvailableTransitions, getDefinition, getFile, getLatestDefinition, getLatestDefinitions, getProcessInstance, getTaskList, getToken, getVariables
 
Methods inherited from interface org.jbpm.Service
close
 

Method Detail

startProcessInstance

public InvocationLog startProcessInstance(java.lang.Long definitionId)
                                   throws ExecutionException
creates a new process instance for the given process definition.

Parameters:
definitionId - is the id of the process definition that has to be started.
Throws:
java.lang.NullPointerException - when processDefinitionId is null.
java.lang.IllegalArgumentException - when processDefinitionId is not a valid process-definition-id.
PersistenceException - when jbpm cannot contact its database.
AuthorizationException - if the swimlane is not authorized to start that process definition.
ExecutionException

startProcessInstance

public InvocationLog startProcessInstance(java.lang.Long definitionId,
                                          java.util.Map variables)
                                   throws ExecutionException
creates a new process instance for the given process definition.

Parameters:
definitionId - is the id of the process definition that has to be started.
variables - are the variables to be stored in the process execution context.
Throws:
java.lang.NullPointerException - when processDefinitionId is null.
java.lang.IllegalArgumentException - when processDefinitionId is not a valid process-definition-id.
PersistenceException - when jbpm cannot contact its database.
AuthorizationException - if the swimlane is not authorized to start that process definition.
ExecutionException

startProcessInstance

public InvocationLog startProcessInstance(java.lang.Long definitionId,
                                          java.util.Map variables,
                                          java.lang.String transitionName)
                                   throws ExecutionException
creates a new process instance for the given process definition.

Parameters:
definitionId - is the id of the process definition that has to be started.
variables - are the variables to be stored in the process execution context.
transitionName - is the name of the transition to be taken from the start-state.
Throws:
java.lang.NullPointerException - when processDefinitionId is null.
java.lang.IllegalArgumentException - when processDefinitionId is not a valid process-definition-id.
PersistenceException - when jbpm cannot contact its database.
AuthorizationException - if the swimlane is not authorized to start that process definition.
IllegalTransitionException - if transitionName is null or does not match with one of the names of the transitions leaving the start-state.
ExecutionException

startProcessInstance

public InvocationLog startProcessInstance(java.lang.String definitionName)
                                   throws ExecutionException
creates a new process instance for the latest version of the given process definition.

Throws:
java.lang.NullPointerException - when processDefinitionId is null.
java.lang.IllegalArgumentException - when processDefinitionId is not a valid process-definition-id.
PersistenceException - when jbpm cannot contact its database.
AuthorizationException - if the swimlane is not authorized to start that process definition.
ExecutionException

startProcessInstance

public InvocationLog startProcessInstance(java.lang.String definitionName,
                                          java.util.Map variables)
                                   throws ExecutionException
creates a new process instance for the latest version of the given process definition.

Parameters:
variables - are the variables to be stored in the process execution context.
Throws:
java.lang.NullPointerException - when processDefinitionId is null.
java.lang.IllegalArgumentException - when processDefinitionId is not a valid process-definition-id.
PersistenceException - when jbpm cannot contact its database.
AuthorizationException - if the swimlane is not authorized to start that process definition.
ExecutionException

startProcessInstance

public InvocationLog startProcessInstance(java.lang.String definitionName,
                                          java.util.Map variables,
                                          java.lang.String transitionName)
                                   throws ExecutionException
creates a new process instance for the latest version of the given process definition.

Parameters:
variables - are the variables to be stored in the process execution context.
transitionName - is the name of the transition to be taken from the start-state.
Throws:
java.lang.NullPointerException - when processDefinitionId is null.
java.lang.IllegalArgumentException - when processDefinitionId is not a valid process-definition-id.
PersistenceException - when jbpm cannot contact its database.
AuthorizationException - if the swimlane is not authorized to start that process definition.
IllegalTransitionException - if transitionName is null or does not match with one of the names of the transitions leaving the start-state.
ExecutionException

setVariables

public InvocationLog setVariables(java.lang.Long tokenId,
                                  java.util.Map variables)
                           throws ExecutionException
stores the variables without signalling an end-of-state.

Throws:
java.lang.NullPointerException - when flowId or attributeValues is null.
java.lang.IllegalArgumentException - when flowId is not a valid flow-id.
PersistenceException - when jbpm cannot contact its database.
ExecutionException

endOfState

public InvocationLog endOfState(java.lang.Long tokenId)
                         throws ExecutionException
will cause the engine to calculate the next state. This method can only be used when exact one transition leaves the current state. If more then one transition leaves the current state of the given flow, use method #endOfState(String,Long,Map,String).

Throws:
ExecutionException

endOfState

public InvocationLog endOfState(java.lang.Long tokenId,
                                java.util.Map variables)
                         throws ExecutionException
will cause the engine to calculate the next state. This method can only be used when exact one transition leaves the current state. If more then one transition leaves the current state of the given flow, use method #endOfState(String,Long,Map,String).

Throws:
ExecutionException

endOfState

public InvocationLog endOfState(java.lang.Long tokenId,
                                java.util.Map variables,
                                java.lang.String transitionName)
                         throws ExecutionException
will cause the engine to calculate the next state. This method can only be used when exact one transition leaves the current state. If more then one transition leaves the current state of the given flow, use method #endOfState(String,Long,Map,String).

Throws:
IllegalTransitionException - if
  • transitionName is null and the state has more then one leaving transition
  • or when the transitionName does not match with one of the names of the transitions leaving the start-state
ExecutionException

reassign

public InvocationLog reassign(java.lang.Long tokenId,
                              java.lang.String newActorId)
                       throws ExecutionException
reassigns the current activity of the given flow to the new actor.

Throws:
ExecutionException

cancelProcessInstance

public InvocationLog cancelProcessInstance(java.lang.Long processInstanceId)
                                    throws ExecutionException
cancels the complete process instance.

Throws:
ExecutionException

cancelToken

public InvocationLog cancelToken(java.lang.Long flowId)
                          throws ExecutionException
cancels one flow in a process instance.

Throws:
ExecutionException

undo

public InvocationLog undo(java.lang.Long processInstanceId,
                          java.util.Date date)
                   throws ExecutionException
brings the process instance back in the state it was at the given time.

Parameters:
processInstanceId - is the process instance on which the undo should operate.
date - is a time in the past to which the process instance state should be reversed. An InvocationLog with a date equal to the given date will also be undone.
Throws:
ExecutionException


Version : jbpm-2.0