org.ow2.bonita.facade.impl
Class RuntimeReadOnlyAPIImpl

java.lang.Object
  extended by org.ow2.bonita.facade.impl.RuntimeReadOnlyAPIImpl
All Implemented Interfaces:
RuntimeReadOnlyAPI
Direct Known Subclasses:
RuntimeAPIImpl

public class RuntimeReadOnlyAPIImpl
extends java.lang.Object
implements RuntimeReadOnlyAPI


Field Summary
protected static java.util.logging.Logger LOG
           
protected  QueryAPI queryAPI
           
 
Constructor Summary
RuntimeReadOnlyAPIImpl()
           
 
Method Summary
protected  org.ow2.bonita.runtime.XpdlInstance getInstance(java.lang.String instanceId)
           
protected  org.ow2.bonita.services.record.TaskRecord getTask(java.lang.String taskId)
           
 java.util.Collection<org.ow2.bonita.services.record.TaskRecord> getTaskList(org.ow2.bonita.util.Constants.TaskState taskState)
          Obtain the user tasks with state either READY or EXECUTING or SUSPENDED for the given instance.
 java.util.Collection<org.ow2.bonita.services.record.TaskRecord> getTaskList(java.lang.String instanceId, org.ow2.bonita.util.Constants.TaskState taskState)
          Obtain the user tasks with state either READY or EXECUTING or SUSPENDED for the given instance.
 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.
protected  org.ow2.bonita.definition.XpdlProcess getXpdlProcess(java.lang.String processId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final java.util.logging.Logger LOG

queryAPI

protected final QueryAPI queryAPI
Constructor Detail

RuntimeReadOnlyAPIImpl

public RuntimeReadOnlyAPIImpl()
Method Detail

getTaskList

public java.util.Collection<org.ow2.bonita.services.record.TaskRecord> getTaskList(java.lang.String instanceId,
                                                                                   org.ow2.bonita.util.Constants.TaskState taskState)
                                                                            throws InstanceNotFoundException
Description copied from interface: RuntimeReadOnlyAPI
Obtain the user tasks with state either READY or EXECUTING or SUSPENDED for the given instance. if the state is READY the task could have been assigned or not. if the state is EXECUTING or SUSPENDED the task has been assigned.

Specified by:
getTaskList in interface RuntimeReadOnlyAPI
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:
InstanceNotFoundException - if no instance record is found with the given instance id.

getTaskList

public java.util.Collection<org.ow2.bonita.services.record.TaskRecord> getTaskList(org.ow2.bonita.util.Constants.TaskState taskState)
Description copied from interface: RuntimeReadOnlyAPI
Obtain the user tasks with state either READY or EXECUTING or SUSPENDED for the given instance. if the state is READY the task could have been assigned or not. if the state is EXECUTING or SUSPENDED the task has been assigned.

Specified by:
getTaskList in interface RuntimeReadOnlyAPI
Parameters:
taskState - the state of the task.
Returns:
a collection of task records. If no tasks are found, an empty collection is returned.

getTask

protected org.ow2.bonita.services.record.TaskRecord getTask(java.lang.String taskId)
                                                     throws TaskNotFoundException
Throws:
TaskNotFoundException

getVariables

public java.util.Map<java.lang.String,java.lang.Object> getVariables(java.lang.String instanceId,
                                                                     java.lang.String activityId)
                                                              throws ActivityNotFoundException
Description copied from interface: RuntimeReadOnlyAPI
Obtain the activity variables (including global process and local activity variables) for the given instance and activity.

Specified by:
getVariables in interface RuntimeReadOnlyAPI
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:
ActivityNotFoundException - if no activity record is found with the given activity id.

getVariable

public java.lang.Object getVariable(java.lang.String instanceId,
                                    java.lang.String activityId,
                                    java.lang.String variableId)
                             throws InstanceNotFoundException,
                                    ActivityNotFoundException,
                                    VariableNotFoundException
Description copied from interface: RuntimeReadOnlyAPI
Obtain a variable for the given activity and instance. This variable could be local to the activity or global to the process.

Specified by:
getVariable in interface RuntimeReadOnlyAPI
Parameters:
instanceId - the instance id.
activityId - the activity id.
variableId - the variable id.
Returns:
the variable object.
Throws:
InstanceNotFoundException - if no instance record is found with the given instance id.
ActivityNotFoundException - if no activity record is found with the given activity id.
VariableNotFoundException - if no variable is found with the given id.

getVariables

public java.util.Map<java.lang.String,java.lang.Object> getVariables(java.lang.String instanceId)
                                                              throws InstanceNotFoundException
Description copied from interface: RuntimeReadOnlyAPI
Obtain the process variables for the given instance.

Specified by:
getVariables in interface RuntimeReadOnlyAPI
Parameters:
instanceId - the instance id.
Returns:
the map of process variables where key is the variable id and value is the variable object.
Throws:
InstanceNotFoundException - if no instance record is found with the given instance id.

getVariable

public java.lang.Object getVariable(java.lang.String instanceId,
                                    java.lang.String variableId)
                             throws InstanceNotFoundException,
                                    VariableNotFoundException
Description copied from interface: RuntimeReadOnlyAPI
Obtain a process variable for the given instance and variable .

Specified by:
getVariable in interface RuntimeReadOnlyAPI
Parameters:
instanceId - the instance id.
variableId - the variable id.
Returns:
the variable object.
Throws:
InstanceNotFoundException - if no instance record is found with the given instance id.
VariableNotFoundException - if no variable is found with the given id.

getVariableDefinitions

public java.util.Map<java.lang.String,java.lang.Object> getVariableDefinitions(java.lang.String processId,
                                                                               java.lang.String activityId)
                                                                        throws ProcessNotFoundException,
                                                                               ActivityNotFoundException
Description copied from interface: RuntimeReadOnlyAPI
Obtain variable definitions (including global process and local activity variables)for the given process and activity.

Specified by:
getVariableDefinitions in interface RuntimeReadOnlyAPI
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:
ProcessNotFoundException - if no process record is found with the given process id.
ActivityNotFoundException - if no activity record is found with the given activity id.

getVariableDefinitions

public java.util.Map<java.lang.String,java.lang.Object> getVariableDefinitions(java.lang.String processId)
                                                                        throws ProcessNotFoundException
Description copied from interface: RuntimeReadOnlyAPI
Obtain the variable definitions of the process for the given process.

Specified by:
getVariableDefinitions in interface RuntimeReadOnlyAPI
Parameters:
processId - 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 record is found with the given process id.

getXpdlProcess

protected org.ow2.bonita.definition.XpdlProcess getXpdlProcess(java.lang.String processId)
                                                        throws ProcessNotFoundException
Throws:
ProcessNotFoundException

getInstance

protected org.ow2.bonita.runtime.XpdlInstance getInstance(java.lang.String instanceId)