org.ow2.bonita.facade
Interface QueryRuntimeAPI


public interface QueryRuntimeAPI

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

Method Summary
 java.util.Map<java.lang.String,ActivityInst> getActivities(java.lang.String instanceId)
          Returns all records of activity for the given instance id.
 ActivityInst getActivity(java.lang.String instanceId, java.lang.String activityId)
          Returns the record of the activity with the given instance id and activity id.
 ProcessInst getInstance(java.lang.String instanceId)
          Returns the record of the instance with the given id.
 java.util.Map<java.lang.String,ProcessInst> getInstances(java.lang.String processId)
          Returns all records of instance for the given process id.
 TaskInst getTask(java.lang.String taskId)
          Returns the record of the task with the given task id.
 java.util.Collection<TaskInst> getTaskList(org.ow2.bonita.util.Constants.TaskState taskState)
           Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance.
 java.util.Collection<TaskInst> getTaskList(java.lang.String instanceId, org.ow2.bonita.util.Constants.TaskState taskState)
          Obtain the user tasks with state either READY or EXECUTING or SUSPENDED or FINISHED for the given instance.
 java.util.Map<java.lang.String,TaskInst> getTasks(java.lang.String instanceId)
          Returns all records of task for the given instance id.
 java.lang.Object getVariable(java.lang.String instanceId, java.lang.String variableId)
          Obtain a process variable for the given instance and variable .
 java.lang.Object getVariable(java.lang.String instanceId, java.lang.String activityId, java.lang.String variableId)
          Obtain a variable for the given activity and instance.
 java.util.Map<java.lang.String,java.lang.Object> getVariableDefinitions(java.lang.String processId)
          Obtain the variable definitions of the process for the given process.
 java.util.Map<java.lang.String,java.lang.Object> getVariableDefinitions(java.lang.String processId, java.lang.String activityId)
          Obtain variable definitions (including global process and local activity variables)for the given process and activity.
 java.util.Map<java.lang.String,java.lang.Object> getVariables(java.lang.String instanceId)
          Obtain the process variables for the given instance.
 java.util.Map<java.lang.String,java.lang.Object> getVariables(java.lang.String instanceId, java.lang.String activityId)
          Obtain the activity variables (including global process and local activity variables) for the given instance and activity.
 

Method Detail

getInstance

ProcessInst getInstance(java.lang.String instanceId)
                        throws org.ow2.bonita.facade.exception.InstanceNotFoundException
Returns the record of the instance with the given id.

Parameters:
instanceId - the instance id.
Returns:
the record of the instance with the given id.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance has been found with the given instance id.
BonitaInternalException - if an exception occurs.

getInstances

java.util.Map<java.lang.String,ProcessInst> getInstances(java.lang.String processId)
                                                         throws org.ow2.bonita.facade.exception.ProcessNotFoundException
Returns all records of instance for the given process id.

Parameters:
processId - the process id.
Returns:
the map containing all instance records. Key is the id of the instance. Value is the record for the instance.
Throws:
org.ow2.bonita.facade.exception.ProcessNotFoundException - if no process has been found with the given process id.
BonitaInternalException - if an exception occurs.

getActivity

ActivityInst getActivity(java.lang.String instanceId,
                         java.lang.String activityId)
                         throws org.ow2.bonita.facade.exception.InstanceNotFoundException,
                                org.ow2.bonita.facade.exception.ActivityNotFoundException
Returns the record of the activity with the given instance id and activity id.

Parameters:
instanceId - the instance id.
activityId - the activity id.
Returns:
the record activity with the given instance id and activity id.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance has been found with the given instance id.
org.ow2.bonita.facade.exception.ActivityNotFoundException - if no activity has been found with the given activity id.
BonitaInternalException - if an exception occurs.

getActivities

java.util.Map<java.lang.String,ActivityInst> getActivities(java.lang.String instanceId)
                                                           throws org.ow2.bonita.facade.exception.InstanceNotFoundException
Returns all records of activity for the given instance id.

Parameters:
instanceId - the instance id.
Returns:
the map containing activity records. Key is the id of the activity. Value is the record for the activity.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance has been found with the given instance id.
BonitaInternalException - if an exception occurs.

getTask

TaskInst getTask(java.lang.String taskId)
                 throws org.ow2.bonita.facade.exception.TaskNotFoundException
Returns the record of the task with the given task id.

Parameters:
taskId - the task id.
Returns:
the record of the task with the given task id.
Throws:
org.ow2.bonita.facade.exception.TaskNotFoundException - if no task has been found with the given task id.
BonitaInternalException - if an exception occurs.

getTasks

java.util.Map<java.lang.String,TaskInst> getTasks(java.lang.String instanceId)
                                                  throws org.ow2.bonita.facade.exception.InstanceNotFoundException
Returns all records of task for the given instance id.

Parameters:
instanceId - the instance id.
Returns:
the map containing all task records. Key is the id of the task. Value is the record for the task.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance has been found with the given instance id.
BonitaInternalException - if an exception occurs.

getTaskList

java.util.Collection<TaskInst> getTaskList(java.lang.String instanceId,
                                           org.ow2.bonita.util.Constants.TaskState taskState)
                                           throws org.ow2.bonita.facade.exception.InstanceNotFoundException

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

Parameters:
instanceId - the instance id.
taskState - the state of the task.
Returns:
a collection of task records. If no tasks are found, an empty collection is returned.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance record is found with the given instance id.
BonitaInternalException - if an other exception occurs.

getTaskList

java.util.Collection<TaskInst> getTaskList(org.ow2.bonita.util.Constants.TaskState taskState)

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

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.

getVariable

java.lang.Object getVariable(java.lang.String instanceId,
                             java.lang.String activityId,
                             java.lang.String variableId)
                             throws org.ow2.bonita.facade.exception.InstanceNotFoundException,
                                    org.ow2.bonita.facade.exception.ActivityNotFoundException,
                                    org.ow2.bonita.facade.exception.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.

Parameters:
instanceId - the instance id.
activityId - the activity id.
variableId - the variable id.
Returns:
the variable object.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance has been found with the given instance id.
org.ow2.bonita.facade.exception.ActivityNotFoundException - if this activity is not pointed by a process execution and the execution informations for this activity has not been recorded.
org.ow2.bonita.facade.exception.VariableNotFoundException - if no variable is found with the given id.
BonitaInternalException - if an other exception occurs.

getVariables

java.util.Map<java.lang.String,java.lang.Object> getVariables(java.lang.String instanceId,
                                                              java.lang.String activityId)
                                                              throws org.ow2.bonita.facade.exception.ActivityNotFoundException,
                                                                     org.ow2.bonita.facade.exception.InstanceNotFoundException
Obtain the activity variables (including global process and local activity variables) for the given instance and activity. An empty map is returned if no variable is found.

Parameters:
instanceId - the instance id.
activityId - the activity id.
Returns:
the map of activity variables where key is the variable id and value is the variable object.
Throws:
org.ow2.bonita.facade.exception.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.
org.ow2.bonita.facade.exception.InstanceNotFoundException

getVariable

java.lang.Object getVariable(java.lang.String instanceId,
                             java.lang.String variableId)
                             throws org.ow2.bonita.facade.exception.InstanceNotFoundException,
                                    org.ow2.bonita.facade.exception.VariableNotFoundException
Obtain a process variable for the given instance and variable .

Parameters:
instanceId - the instance id.
variableId - the variable id.
Returns:
the variable object.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance has found with the given instance id.
org.ow2.bonita.facade.exception.VariableNotFoundException - if no variable is found with the given id.
BonitaInternalException - if an other exception occurs.

getVariables

java.util.Map<java.lang.String,java.lang.Object> getVariables(java.lang.String instanceId)
                                                              throws org.ow2.bonita.facade.exception.InstanceNotFoundException
Obtain the process variables for the given instance. An empty map is returned if no process variable is found.

Parameters:
instanceId - the instance id.
Returns:
the map of process variables where key is the variable id and value is the variable object.
Throws:
org.ow2.bonita.facade.exception.InstanceNotFoundException - if no instance has been found with the given instance id.
BonitaInternalException - if an other exception occurs.

getVariableDefinitions

java.util.Map<java.lang.String,java.lang.Object> getVariableDefinitions(java.lang.String processId,
                                                                        java.lang.String activityId)
                                                                        throws org.ow2.bonita.facade.exception.ProcessNotFoundException,
                                                                               org.ow2.bonita.facade.exception.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.

Parameters:
processId - the process Id.
activityId - the activity id.
Returns:
the map of variable definitions where key is the variable id and value is the variable object.
Throws:
org.ow2.bonita.facade.exception.ProcessNotFoundException - if no process record is found with the given process id.
org.ow2.bonita.facade.exception.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.

getVariableDefinitions

java.util.Map<java.lang.String,java.lang.Object> getVariableDefinitions(java.lang.String processId)
                                                                        throws org.ow2.bonita.facade.exception.ProcessNotFoundException
Obtain the variable definitions of the process for the given process. An empty map is returned if no variable definition is found.

Parameters:
processId - the process Id.
Returns:
the map of variable definitions where key is the variable id and value is the variable object.
Throws:
org.ow2.bonita.facade.exception.ProcessNotFoundException - if no process has been found with the given process id.
BonitaInternalException - if an other exception occurs.