com.sap.bpm.tm.api

Interface TaskInstanceManager


public interface TaskInstanceManager

Central access point for getting and manipulating task instances.

NOTE: As this interface can be extended, this interface can be freely used, but must not be implemented.


Method Summary
 void claim(URI taskInstanceId)
          Claims responsibility for the task, i.e. sets the task to status Reserved
 void complete(URI taskInstanceId, commonj.sdo.DataObject taskOutputData)
          Completes the execution of the task, i.e. sets the task to status Completed
 void fail(URI taskInstanceId, Fault fault)
          Lets the execution of the task fail with the specified fault.
 URL generateTaskExecutionUrl(URI taskInstanceId)
          Generates the URL pointing to the default Task Execution UI for the specified task instance id.
 Set<TaskAbstract> getMyTaskAbstracts(Set<Status> statuses)
          Returns the set of instances of TaskAbstract for the logged in user and for the specified task statuses.
 TaskAbstract getTaskAbstract(URI taskInstanceId)
          Returns an abstract of the task with the given task instance id
 TaskDetail getTaskDetail(URI taskInstanceId)
          Returns the details of the task with the given task instance id.
 void start(URI taskInstanceId)
          Starts the execution of the task, i.e. sets the task to status InProgress.
 void stop(URI taskInstanceId)
          Stops the execution of the task and sets the task status back to Reservered.
 

Method Detail

claim

void claim(URI taskInstanceId)
           throws BPMException
Claims responsibility for the task, i.e. sets the task to status Reserved

Parameters:
taskInstanceId -
Throws:
BPMIllegalArgumentException - if an argument is invalid
BPMIllegalAccessException - if the user is not authorized to perform the operation
BPMIllegalOperationException - if the operation does not apply to the task type
BPMException

start

void start(URI taskInstanceId)
           throws BPMException
Starts the execution of the task, i.e. sets the task to status InProgress.

Parameters:
taskInstanceId -
Throws:
BPMIllegalStateException - if the state is invalid
BPMIllegalArgumentException - if an argument is invalid
BPMIllegalAccessException - if the user is not authorized to perform the operation
BPMIllegalOperationException - if the operation does not apply to the task type
BPMException

stop

void stop(URI taskInstanceId)
          throws BPMException
Stops the execution of the task and sets the task status back to Reservered.

Parameters:
taskInstanceId -
Throws:
BPMIllegalStateException - if the state is invalid
BPMIllegalArgumentException - if an argument is invalid
BPMIllegalAccessException - if the user is not authorized to perform the operation
BPMIllegalOperationException - if the operation does not apply to the task type
BPMException

complete

void complete(URI taskInstanceId,
              commonj.sdo.DataObject taskOutputData)
              throws BPMException
Completes the execution of the task, i.e. sets the task to status Completed

Parameters:
taskInstanceId -
taskOutputData - the output data that will be used to complete the task.
It must be of a supported implementation (SAP) and matching type, otherwise the method will throw a BPMIllegalArgumentException.
Use TaskDetail.getOutputDataObject() to get a valid data object.
Throws:
BPMIllegalStateException - if the state is invalid
BPMIllegalArgumentException - if an argument is invalid
BPMIllegalAccessException - if the user is not authorized to perform the operation
BPMIllegalOperationException - if the operation does not apply to the task type
BPMException

getTaskDetail

TaskDetail getTaskDetail(URI taskInstanceId)
                         throws BPMException
Returns the details of the task with the given task instance id.
Applies to both tasks and notifications.

Parameters:
taskInstanceId -
Returns:
task details
Throws:
IllegalArgumentException - if an argument is invalid
BPMException

getTaskAbstract

TaskAbstract getTaskAbstract(URI taskInstanceId)
                             throws BPMException
Returns an abstract of the task with the given task instance id

Parameters:
taskInstanceId -
Returns:
task abstract
Throws:
BPMIllegalAccessException - if the user is not authorized to perform the operation
BPMIllegalArgumentException - if an argument is invalid
BPMException

getMyTaskAbstracts

Set<TaskAbstract> getMyTaskAbstracts(Set<Status> statuses)
                                     throws BPMException
Returns the set of instances of TaskAbstract for the logged in user and for the specified task statuses. If null is provided as argument, the abstracts for the tasks with a valid status are returned.

Parameters:
statuses -
Returns:
a Set of instances of {link TaskAbstract}
Throws:
BPMException

fail

void fail(URI taskInstanceId,
          Fault fault)
          throws BPMException
Lets the execution of the task fail with the specified fault.

Parameters:
taskInstanceId -
fault - the Fault Object representing the reason why the execution of the task has failed
Throws:
BPMIllegalAccessException - if the user is not authorized to perform the operation
BPMIllegalArgumentException - if an argument is invalid
BPMException

generateTaskExecutionUrl

URL generateTaskExecutionUrl(URI taskInstanceId)
                             throws BPMException
Generates the URL pointing to the default Task Execution UI for the specified task instance id.
The application property 'http.baseurl' will be used to determine the target server and port address.

Parameters:
taskInstanceId -
Returns:
the generated Task Execution UI URL
Throws:
BPMIllegalArgumentException - if an argument is invalid
BPMServiceException - if a backend-issue occurrs
BPMException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] BPEM-FACADE [sap.com] tc/bpem/facade/ear - BC-BMT-BPM
[sap.com] BPEM-FACADE [sap.com] tc/bpem/facade/ear api BC-BMT-BPM


Copyright 2011 SAP AG Complete Copyright Notice