org.ow2.bonita.facade
Interface RuntimeAPI

All Superinterfaces:
org.ow2.bonita.facade.remote.RemoteRuntimeAPI

public interface RuntimeAPI
extends org.ow2.bonita.facade.remote.RemoteRuntimeAPI

To manage process, process instance and task life cycle operations as well as to set/add/update variables within activity or instance. Default states for process, processes instances, tasks (aka manual activities) are:

Author:
Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
See Also:
TxHook

Method Summary
 void addActivityInstanceVariable(ActivityInstanceUUID activityUUID, java.lang.String variableId, java.lang.Object variableValue)
           
 void addActivityInstanceVariable(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String variableId, java.lang.Object variableValue)
           
 void addProcessInstanceVariable(ProcessInstanceUUID instanceUUID, java.lang.String variableId, java.lang.Object variableValue)
           
 void deleteAllProcessInstances(ProcessDefinitionUUID processUUID)
          Deletes all runtime objects for all instances created with the given process UUID and delete also all there recorded data from the journal.
 void deleteProcessInstance(ProcessInstanceUUID instanceUUID)
          Deletes all runtime objects for the process instance with the given instance UUID and delete also recorded data from the journal.
 void finishTask(TaskUUID taskUUID)
          Finishes the task.
 ProcessInstanceUUID instantiateProcess(ProcessDefinitionUUID processUUID)
          Creates an instance of the specified process and start the execution.
 ProcessInstanceUUID instantiateProcess(ProcessDefinitionUUID processUUID, java.util.Map<java.lang.String,java.lang.Object> variables)
          creates an instance of the specified process with the added variable map and start the execution.
 void resumeTask(TaskUUID taskUUID)
          Resumes the task if the task has SUSPENDED state.
 void setActivityInstanceVariable(ActivityInstanceUUID activityUUID, java.lang.String variableId, java.lang.Object variableValue)
          Searches for variable with the given activity UUID and variable Id.
 void setActivityInstanceVariable(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String variableId, java.lang.Object variableValue)
          Searches for variable with id variableId into instance with UUID processUUID and within the activity with id activityId.
 void setProcessInstanceVariable(ProcessInstanceUUID instanceUUID, java.lang.String variableId, java.lang.Object variableValue)
          Searches for variable with id variableId within the given process instance with ProcessInstanceUUID instanceUUID.
 void setVariable(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String variableId, java.lang.Object variableValue)
           
 void startTask(TaskUUID taskUUID)
          starts the task.
 void suspendTask(TaskUUID taskUUID)
          Suspends the task if the task has EXECUTING state.
 

Method Detail

instantiateProcess

ProcessInstanceUUID instantiateProcess(ProcessDefinitionUUID processUUID)
                                       throws ProcessNotFoundException
Creates an instance of the specified process and start the execution. returned instance has STARTED state. If the first activity has StartMode=manual then a task has been created. If the first activity has StartMode=automatic then the automatic behavior of the activity has been started.

Specified by:
instantiateProcess in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
processUUID - the process UUID.
Returns:
the UUID of the created instance.
Throws:
ProcessNotFoundException - if the process has not been found.
BonitaInternalException - if an exception occurs.

instantiateProcess

ProcessInstanceUUID instantiateProcess(ProcessDefinitionUUID processUUID,
                                       java.util.Map<java.lang.String,java.lang.Object> variables)
                                       throws ProcessNotFoundException
creates an instance of the specified process with the added variable map and start the execution. returned instance has STARTED state. If the first activity has StartMode=manual then a task has been created. If the first activity has StartMode=automatic then the automatic behavior of the activity has been started.

Specified by:
instantiateProcess in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
processUUID - the process UUID.
variables - variables added to the variables already set within the process definition.
Returns:
the UUID of the created instance.
Throws:
ProcessNotFoundException - if the process has not been found.
BonitaInternalException - if an exception occurs.

startTask

void startTask(TaskUUID taskUUID)
               throws TaskNotFoundException,
                      IllegalTaskStateException
starts the task. If successful, this operation changes task state from READY to EXECUTING.

Specified by:
startTask in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
taskUUID - the task UUID.
Throws:
TaskNotFoundException - if the task has not been found.
IllegalTaskStateException - if the state of the task has not READY state.
BonitaInternalException - if an exception occurs.

finishTask

void finishTask(TaskUUID taskUUID)
                throws TaskNotFoundException,
                       IllegalTaskStateException
Finishes the task. If successful, this operation changes task state from EXECUTING to FINISHED.

Specified by:
finishTask in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
taskUUID - the task UUID.
Throws:
TaskNotFoundException - if the task has not been found.
IllegalTaskStateException - if the state of the task has not EXECUTING state.
BonitaInternalException - if an exception occurs.

suspendTask

void suspendTask(TaskUUID taskUUID)
                 throws TaskNotFoundException,
                        IllegalTaskStateException,
                        UnAuthorizedUserException
Suspends the task if the task has EXECUTING state.
If successful, this operation changes task state from EXECUTING to SUSPENDED.

Specified by:
suspendTask in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
taskUUID - the task UUID.
Throws:
TaskNotFoundException - if the task has not been found.
IllegalTaskStateException - if the state of the task has not either READY or EXECUTING state.
UnAuthorizedUserException - if the user is not the user assigned to the task.
UnAuthorizedUserException - if task has not been assigned and the user is not in the list of candidates for the task.
BonitaInternalException - if an exception occurs.

resumeTask

void resumeTask(TaskUUID taskUUID)
                throws TaskNotFoundException,
                       IllegalTaskStateException,
                       UnAuthorizedUserException
Resumes the task if the task has SUSPENDED state. If successful, this operation changes task state from SUSPENDED to EXECUTING.

Specified by:
resumeTask in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
taskUUID - the task UUID.
Throws:
TaskNotFoundException - if the task has not been found.
IllegalTaskStateException - if the state of the task has not SUSPENDED state.
UnAuthorizedUserException - if the user is not the user assigned to the task.
UnAuthorizedUserException - if task has not been assigned and the user is not in the list of candidates for the task.
BonitaInternalException - if an exception occurs.

setProcessInstanceVariable

void setProcessInstanceVariable(ProcessInstanceUUID instanceUUID,
                                java.lang.String variableId,
                                java.lang.Object variableValue)
                                throws InstanceNotFoundException,
                                       VariableNotFoundException
Searches for variable with id variableId within the given process instance with ProcessInstanceUUID instanceUUID.
If the variable is found, the given value is set.
The field selectedValue of Enumeration type can contain only one value from the possibleValues list field.

Specified by:
setProcessInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
variableId - the variable id.
variableValue - the variable value.
Throws:
InstanceNotFoundException - if the instance has not been found.
BonitaInternalException - if an exception occurs.
VariableNotFoundException

setVariable

void setVariable(ProcessInstanceUUID instanceUUID,
                 java.lang.String activityId,
                 java.lang.String variableId,
                 java.lang.Object variableValue)
                 throws InstanceNotFoundException,
                        ActivityNotFoundException,
                        VariableNotFoundException
Specified by:
setVariable in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Throws:
InstanceNotFoundException
ActivityNotFoundException
VariableNotFoundException

setActivityInstanceVariable

void setActivityInstanceVariable(ProcessInstanceUUID instanceUUID,
                                 java.lang.String activityId,
                                 java.lang.String variableId,
                                 java.lang.Object variableValue)
                                 throws InstanceNotFoundException,
                                        ActivityNotFoundException,
                                        VariableNotFoundException
Searches for variable with id variableId into instance with UUID processUUID and within the activity with id activityId.
If the activity variable is found, the given value is set.
The field selectedValue can contain only one value from the possibleValues list field.

Specified by:
setActivityInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
activityId - the activity id.
variableId - the variable id.
variableValue - the variable value.
Throws:
InstanceNotFoundException - if the instance has not been found.
ActivityNotFoundException - if the activity has not been found.
BonitaInternalException - if an exception occurs.
VariableNotFoundException

setActivityInstanceVariable

void setActivityInstanceVariable(ActivityInstanceUUID activityUUID,
                                 java.lang.String variableId,
                                 java.lang.Object variableValue)
                                 throws ActivityNotFoundException,
                                        VariableNotFoundException
Searches for variable with the given activity UUID and variable Id.
If the activity variable is found, the given value is set.
The field selectedValue can contain only one value from the possibleValues list field.

Specified by:
setActivityInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
activityUUID - the activity UUID.
variableId - the variable id.
variableValue - the variable value.
Throws:
ActivityNotFoundException - if the activity has not been found.
BonitaInternalException - if an exception occurs.
VariableNotFoundException

addProcessInstanceVariable

void addProcessInstanceVariable(ProcessInstanceUUID instanceUUID,
                                java.lang.String variableId,
                                java.lang.Object variableValue)
                                throws InstanceNotFoundException,
                                       VariableAlreadyExistException
Specified by:
addProcessInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Throws:
InstanceNotFoundException
VariableAlreadyExistException

addActivityInstanceVariable

void addActivityInstanceVariable(ProcessInstanceUUID instanceUUID,
                                 java.lang.String activityId,
                                 java.lang.String variableId,
                                 java.lang.Object variableValue)
                                 throws InstanceNotFoundException,
                                        ActivityNotFoundException,
                                        VariableAlreadyExistException
Specified by:
addActivityInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Throws:
InstanceNotFoundException
ActivityNotFoundException
VariableAlreadyExistException

addActivityInstanceVariable

void addActivityInstanceVariable(ActivityInstanceUUID activityUUID,
                                 java.lang.String variableId,
                                 java.lang.Object variableValue)
                                 throws ActivityNotFoundException,
                                        VariableAlreadyExistException
Specified by:
addActivityInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Throws:
ActivityNotFoundException
VariableAlreadyExistException

deleteProcessInstance

void deleteProcessInstance(ProcessInstanceUUID instanceUUID)
                           throws InstanceNotFoundException
Deletes all runtime objects for the process instance with the given instance UUID and delete also recorded data from the journal.

Specified by:
deleteProcessInstance in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
Throws:
InstanceNotFoundException - if if the instance has not been found.
BonitaInternalException - if an exception occurs.

deleteAllProcessInstances

void deleteAllProcessInstances(ProcessDefinitionUUID processUUID)
Deletes all runtime objects for all instances created with the given process UUID and delete also all there recorded data from the journal.

Specified by:
deleteAllProcessInstances in interface org.ow2.bonita.facade.remote.RemoteRuntimeAPI
Parameters:
processUUID - the process UUID.
Throws:
BonitaInternalException - if an exception occurs.