org.ow2.bonita.facade
Interface QueryRuntimeAPI

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

public interface QueryRuntimeAPI
extends org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI

Getters on workflow recorded data.
Operations in this API applies to main entities managed by Nova Bonita such as:
packages, processes, process instances, activities, tasks.
Returned records are issued from recorded runtime informations (both runtime and archived workflow instances).

Author:
Pierre Vigneras, Charles Souillard
See Also:
RoleMapper, PerformerAssign, Hook

Method Summary
 ActivityInstance<ActivityBody> getActivityInstance(ActivityInstanceUUID activityUUID)
          Returns the record of the activity with the given activity UUID.
 ActivityInstance<ActivityBody> getActivityInstance(ProcessInstanceUUID instanceUUID, java.lang.String activityId)
          Returns the record of the activity with the given instance UUID and activity Id.
 ActivityInstance<ActivityBody> getActivityInstance(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String iterationId)
          Returns the record of the activity with the given instance processDefinitionUUID and activity processDefinitionUUID.
 java.util.Set<ActivityInstance<ActivityBody>> getActivityInstances(ProcessInstanceUUID instanceUUID)
          Returns all records of activity for the given instance UUID.
 java.util.Set<ActivityInstance<ActivityBody>> getActivityInstances(ProcessInstanceUUID instanceUUID, java.lang.String activityId)
          Returns records for all iterations that should happend for the given instance UUID and activity Id.
 java.lang.Object getActivityInstanceVariable(ActivityInstanceUUID activityUUID, java.lang.String variableId)
          Obtain a variable for the given activity UUID.
 java.lang.Object getActivityInstanceVariable(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String variableId)
          Obtain a variable for the given activity and instance.
 java.lang.Object getActivityInstanceVariable(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String iterationId, java.lang.String variableId)
          Obtain a variable for the given the given instance UUID, the activity Id and the iterationId, variableId.
 java.util.Map<java.lang.String,java.lang.Object> getActivityInstanceVariables(ActivityInstanceUUID activityUUID)
          Obtain the activity variables (including global process and local activity variables) for the given activity UUID.
 java.util.Map<java.lang.String,java.lang.Object> getActivityInstanceVariables(ProcessInstanceUUID instanceUUID, java.lang.String activityId)
          Obtain the activity variables (including global process and local activity variables) for the given instance UUID and activity Id.
 java.util.Map<java.lang.String,java.lang.Object> getActivityInstanceVariables(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String iterationId)
          Obtain the activity variables (including global process and local activity variables) for the given instance UUID, the activity Id and the iterationId
An empty map is returned if no variable is found.
 java.util.Map<java.lang.String,java.lang.Object> getActivityVariableDefinitions(ProcessDefinitionUUID processUUID, java.lang.String activityId)
          Obtain variable definitions (including global process and local activity variables)for the given process and activity.
 ProcessInstance getProcessInstance(ProcessInstanceUUID instanceUUID)
          Returns the record of the instance with the given UUID.
 java.util.Set<ProcessInstance> getProcessInstances(ProcessDefinitionUUID processUUID)
          Returns all records of instance for the given process processDefinitionUUID.
 java.lang.Object getProcessInstanceVariable(ProcessInstanceUUID instanceUUID, java.lang.String variableId)
          Obtain a process variable for the given instance and variable.
 java.util.Map<java.lang.String,java.lang.Object> getProcessInstanceVariables(ProcessInstanceUUID instanceUUID)
          Obtain the process variables for the given instance.
 java.util.Map<java.lang.String,java.lang.Object> getProcessVariableDefinitions(ProcessDefinitionUUID processUUID)
          Obtain the variable definitions of the process for the given process.
 ActivityInstance<TaskInstance> getTask(TaskUUID taskUUID)
          Returns the record of the task with the given task UUID.
 java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(ProcessInstanceUUID instanceUUID, java.lang.String userId, TaskState taskState)
          Obtain the tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance for the given user id.
 java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(ProcessInstanceUUID instanceUUID, TaskState taskState)
          Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance.
 java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(java.lang.String userId, TaskState taskState)
           Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance for the given user id.
 java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(TaskState taskState)
           Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance.
 java.util.Set<ActivityInstance<TaskInstance>> getTasks(ProcessInstanceUUID instanceUUID)
          Returns all records of task for the given instance UUID.
 java.lang.Object getVariable(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String variableId)
           
 java.util.Map<java.lang.String,java.lang.Object> getVariables(ProcessInstanceUUID instanceUUID, java.lang.String activityId, java.lang.String variableId)
           
 

Method Detail

getProcessInstance

ProcessInstance getProcessInstance(ProcessInstanceUUID instanceUUID)
                                   throws InstanceNotFoundException
Returns the record of the instance with the given UUID.

Specified by:
getProcessInstance in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
Returns:
the record of the instance with the given UUID.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
BonitaInternalException - if an exception occurs.

getProcessInstances

java.util.Set<ProcessInstance> getProcessInstances(ProcessDefinitionUUID processUUID)
                                                   throws ProcessNotFoundException
Returns all records of instance for the given process processDefinitionUUID.
An empty set is returned if no instance is found.

Specified by:
getProcessInstances in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
processUUID - the process definition UUID.
Returns:
a set containing all instance records.
Throws:
ProcessNotFoundException - if no process has been found with the given process UUID.
BonitaInternalException - if an exception occurs.

getActivityInstance

ActivityInstance<ActivityBody> getActivityInstance(ProcessInstanceUUID instanceUUID,
                                                   java.lang.String activityId,
                                                   java.lang.String iterationId)
                                                   throws InstanceNotFoundException,
                                                          ActivityNotFoundException
Returns the record of the activity with the given instance processDefinitionUUID and activity processDefinitionUUID.

Specified by:
getActivityInstance in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance processDefinitionUUID.
activityId - the activity Id as specified in the xpdl file.
iterationId - the iteration Id.
Returns:
the activity record with the given instance UUID and activity id.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
ActivityNotFoundException - if no activity has been found with the given activity id.
BonitaInternalException - if an exception occurs.

getActivityInstance

ActivityInstance<ActivityBody> getActivityInstance(ActivityInstanceUUID activityUUID)
                                                   throws ActivityNotFoundException
Returns the record of the activity with the given activity UUID.

Specified by:
getActivityInstance in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
activityUUID - the activity UUID.
Returns:
the activity record with the given instance UUID and activity id.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
ActivityNotFoundException - if no activity has been found with the given activity id.
BonitaInternalException - if an exception occurs.

getActivityInstance

ActivityInstance<ActivityBody> getActivityInstance(ProcessInstanceUUID instanceUUID,
                                                   java.lang.String activityId)
                                                   throws InstanceNotFoundException,
                                                          ActivityNotFoundException,
                                                          ActivityInIterationException
Returns the record of the activity with the given instance UUID and activity Id.

Specified by:
getActivityInstance in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance processDefinitionUUID.
activityId - the activity Id as specified in the xpdl file.
Returns:
the activity record with the given instance UUID and activity id.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
ActivityNotFoundException - if no activity has been found with the given activity id.
ActivityInIterationException - if there's iterations.
BonitaInternalException - if an exception occurs.

getActivityInstances

java.util.Set<ActivityInstance<ActivityBody>> getActivityInstances(ProcessInstanceUUID instanceUUID)
                                                                   throws InstanceNotFoundException
Returns all records of activity for the given instance UUID.

Specified by:
getActivityInstances in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
Returns:
the unordered set containing activity records.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
BonitaInternalException - if an exception occurs.

getActivityInstances

java.util.Set<ActivityInstance<ActivityBody>> getActivityInstances(ProcessInstanceUUID instanceUUID,
                                                                   java.lang.String activityId)
                                                                   throws InstanceNotFoundException,
                                                                          ActivityNotFoundException
Returns records for all iterations that should happend for the given instance UUID and activity Id.
An empty set is returned if no instance is found.

Specified by:
getActivityInstances in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
activityId - the activity Id (as specified into the XPDL file).
Returns:
the unordered set containing activity records.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
BonitaInternalException - if an exception occurs.
ActivityNotFoundException

getTask

ActivityInstance<TaskInstance> getTask(TaskUUID taskUUID)
                                       throws TaskNotFoundException
Returns the record of the task with the given task UUID.

Specified by:
getTask in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
taskUUID - the task UUID.
Returns:
the record of the task with the given task UUID.
Throws:
TaskNotFoundException - if no task has been found with the given task UUID.
BonitaInternalException - if an exception occurs.

getTasks

java.util.Set<ActivityInstance<TaskInstance>> getTasks(ProcessInstanceUUID instanceUUID)
                                                       throws InstanceNotFoundException
Returns all records of task for the given instance UUID.

Specified by:
getTasks in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
Returns:
a set containing all task records for the instance.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
BonitaInternalException - if an exception occurs.

getTaskList

java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(ProcessInstanceUUID instanceUUID,
                                                                 TaskState taskState)
                                                                 throws InstanceNotFoundException

Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance.

Specified by:
getTaskList in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
taskState - the state of the task.
Returns:
a collection of task records. If no tasks are found, an empty collection is returned.
Throws:
InstanceNotFoundException - if no instance record is found with the given instance UUID.
BonitaInternalException - if an other exception occurs.

getTaskList

java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(ProcessInstanceUUID instanceUUID,
                                                                 java.lang.String userId,
                                                                 TaskState taskState)
                                                                 throws InstanceNotFoundException

Obtain the tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance for the given user id.

Parameters:
instanceUUID - the instance UUID.
userId - the userId for which the tasks are searched.
taskState - the state of the task.
Returns:
a collection of task records. If no tasks are found, an empty collection is returned.
Throws:
InstanceNotFoundException - if no instance record is found with the given instance UUID.
BonitaInternalException - if an other exception occurs.

getTaskList

java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(TaskState taskState)

Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance.

Specified by:
getTaskList in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
taskState - the state of the task.
Returns:
a collection of task records. If no tasks are found, an empty collection is returned.
Throws:
BonitaInternalException - if an other exception occurs.

getTaskList

java.util.Collection<ActivityInstance<TaskInstance>> getTaskList(java.lang.String userId,
                                                                 TaskState taskState)

Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance for the given user id.

Parameters:
userId - the userId for which the tasks are searched.
taskState - the state of the task.
Returns:
a collection of task records. If no tasks are found, an empty collection is returned.
Throws:
BonitaInternalException - if an other exception occurs.

getActivityInstanceVariable

java.lang.Object getActivityInstanceVariable(ProcessInstanceUUID instanceUUID,
                                             java.lang.String activityId,
                                             java.lang.String variableId)
                                             throws InstanceNotFoundException,
                                                    ActivityNotFoundException,
                                                    ActivityInIterationException,
                                                    VariableNotFoundException
Obtain a variable for the given activity and instance. This variable could be local to the activity or global to the process. The activity should either be executed or currently pointed by the a process execution.

Specified by:
getActivityInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
activityId - the value of the Id attribute of the Activity element defined into the XPDL file.
variableId - the value of the Id attribute of the DataField element defined into the XPDL file.
Returns:
the variable object.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded.
ActivityInIterationException - if multiple iterations has been occurred for the given activity Id.
VariableNotFoundException - if no variable is found with the given id.
BonitaInternalException - if an other exception occurs.

getActivityInstanceVariable

java.lang.Object getActivityInstanceVariable(ActivityInstanceUUID activityUUID,
                                             java.lang.String variableId)
                                             throws ActivityNotFoundException,
                                                    VariableNotFoundException
Obtain a variable for the given activity UUID. This variable could be local to the activity or global to the process. The activity should either be executed or currently pointed by the a process execution.

Specified by:
getActivityInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
activityUUID - the activity UUID.
variableId - the value of the Id attribute of the DataField element defined into the XPDL file.
Returns:
the map of activity variables where key is the variable id and value is the variable object.
Throws:
ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded.
VariableNotFoundException - if no variable is found with the given id.
BonitaInternalException - if an other exception occurs.

getActivityInstanceVariable

java.lang.Object getActivityInstanceVariable(ProcessInstanceUUID instanceUUID,
                                             java.lang.String activityId,
                                             java.lang.String iterationId,
                                             java.lang.String variableId)
                                             throws InstanceNotFoundException,
                                                    ActivityNotFoundException,
                                                    VariableNotFoundException
Obtain a variable for the given the given instance UUID, the activity Id and the iterationId, variableId. This variable could be local to the activity or global to the process. The activity should either be executed or currently pointed by the a process execution.

Specified by:
getActivityInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
activityId - the value of the Id attribute of the Activity element defined into the XPDL file.
iterationId - the iteration Id.
variableId - the value of the Id attribute of the DataField element defined into the XPDL file.
Returns:
the map of activity variables where key is the variable id and value is the variable object.
Throws:
ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded or if the iteration id has not been found.
InstanceNotFoundException - if no recorded informations is found with the given instance UUID.
VariableNotFoundException - if no variable is found with the given id.
BonitaInternalException - if an other exception occurs.

getActivityInstanceVariables

java.util.Map<java.lang.String,java.lang.Object> getActivityInstanceVariables(ProcessInstanceUUID instanceUUID,
                                                                              java.lang.String activityId)
                                                                              throws ActivityNotFoundException,
                                                                                     ActivityInIterationException,
                                                                                     InstanceNotFoundException
Obtain the activity variables (including global process and local activity variables) for the given instance UUID and activity Id.
An empty map is returned if no variable is found.

Specified by:
getActivityInstanceVariables in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
activityId - the value of the Id attribute of the Activity element defined into the XPDL file.
Returns:
the map of activity variables where key is the variable id and value is the variable object.
Throws:
ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded.
InstanceNotFoundException - if no recorded informations is found with the given instance UUID.
ActivityInIterationException - if multiple iterations has been occurred.
BonitaInternalException - if an other exception occurs.

getActivityInstanceVariables

java.util.Map<java.lang.String,java.lang.Object> getActivityInstanceVariables(ActivityInstanceUUID activityUUID)
                                                                              throws ActivityNotFoundException
Obtain the activity variables (including global process and local activity variables) for the given activity UUID.
An empty map is returned if no variable is found.

Specified by:
getActivityInstanceVariables in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
activityUUID - the activity UUID.
Returns:
the map of activity variables where key is the variable id and value is the variable object.
Throws:
ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded.
BonitaInternalException - if an other exception occurs.

getActivityInstanceVariables

java.util.Map<java.lang.String,java.lang.Object> getActivityInstanceVariables(ProcessInstanceUUID instanceUUID,
                                                                              java.lang.String activityId,
                                                                              java.lang.String iterationId)
                                                                              throws ActivityNotFoundException,
                                                                                     InstanceNotFoundException
Obtain the activity variables (including global process and local activity variables) for the given instance UUID, the activity Id and the iterationId
An empty map is returned if no variable is found.

Specified by:
getActivityInstanceVariables in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
activityId - the value of the Id attribute of the Activity element defined into the XPDL file.
iterationId - the iteration Id.
Returns:
the map of activity variables where key is the variable id and value is the variable object.
Throws:
ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded or if the iteration id has not been found.
InstanceNotFoundException - if no recorded informations is found with the given instance UUID.
BonitaInternalException - if an other exception occurs.

getVariable

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

getVariables

java.util.Map<java.lang.String,java.lang.Object> getVariables(ProcessInstanceUUID instanceUUID,
                                                              java.lang.String activityId,
                                                              java.lang.String variableId)
                                                              throws InstanceNotFoundException,
                                                                     ActivityNotFoundException,
                                                                     VariableNotFoundException
Specified by:
getVariables in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Throws:
InstanceNotFoundException
ActivityNotFoundException
VariableNotFoundException

getProcessInstanceVariable

java.lang.Object getProcessInstanceVariable(ProcessInstanceUUID instanceUUID,
                                            java.lang.String variableId)
                                            throws InstanceNotFoundException,
                                                   VariableNotFoundException
Obtain a process variable for the given instance and variable.

Specified by:
getProcessInstanceVariable in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
variableId - the variable id.
Returns:
the variable object.
Throws:
InstanceNotFoundException - if no instance has found with the given instance UUID.
VariableNotFoundException - if no variable is found with the given id.
BonitaInternalException - if an other exception occurs.

getProcessInstanceVariables

java.util.Map<java.lang.String,java.lang.Object> getProcessInstanceVariables(ProcessInstanceUUID instanceUUID)
                                                                             throws InstanceNotFoundException
Obtain the process variables for the given instance. An empty map is returned if no process variable is found.

Specified by:
getProcessInstanceVariables in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
instanceUUID - the instance UUID.
Returns:
the map of process variables where key is the variable id and value is the variable object.
Throws:
InstanceNotFoundException - if no instance has been found with the given instance UUID.
BonitaInternalException - if an other exception occurs.

getActivityVariableDefinitions

java.util.Map<java.lang.String,java.lang.Object> getActivityVariableDefinitions(ProcessDefinitionUUID processUUID,
                                                                                java.lang.String activityId)
                                                                                throws ProcessNotFoundException,
                                                                                       ActivityNotFoundException
Obtain variable definitions (including global process and local activity variables)for the given process and activity. An empty map is returned if no variable definition is found.

Specified by:
getActivityVariableDefinitions in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
processUUID - the process UUID.
activityId - the activity id as specified in the xpdl file.
Returns:
the map of variable definitions where key is the variable id and value is the variable object.
Throws:
ProcessNotFoundException - if no process record is found with the given process UUID.
ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded.
BonitaInternalException - if an other exception occurs.

getProcessVariableDefinitions

java.util.Map<java.lang.String,java.lang.Object> getProcessVariableDefinitions(ProcessDefinitionUUID processUUID)
                                                                               throws ProcessNotFoundException
Obtain the variable definitions of the process for the given process. An empty map is returned if no variable definition is found.

Specified by:
getProcessVariableDefinitions in interface org.ow2.bonita.facade.remote.RemoteQueryRuntimeAPI
Parameters:
processUUID - the process Id.
Returns:
the map of variable definitions where key is the variable id and value is the variable object.
Throws:
ProcessNotFoundException - if no process has been found with the given process UUID.
BonitaInternalException - if an other exception occurs.