You have added the necessary dependencies to development component tc/bpem/facade/ear (public part api ) in software component BPEM-FACADE and tc/je/sdo21/api in the software component ENGFACADE .
With the Business Process Management (BPM) application programming interfaces (APIs), you can customize and enhance the way you use business processes and execute tasks.
This document describes how you use the BPM APIs to build your own task execution UI.
For a detailed description of the BPM public APIs, see http://help.sap.com/javadocs/.
TaskInstanceManager taskInstanceManager = BPMFactory.getTaskInstanceManager();
Typically, you use READY , RESERVED and IN_PROGRESS statuses, which mean that the tasks are ready to work on and the user is a potential or actual owner of the task.
HashSet<Status> statuses = new HashSet<Status>(); statuses.add(Status.READY); statuses.add(Status.RESERVED); statuses.add(Status.IN_PROGRESS);
The returned set contains TaskAbstracts, which are basic descriptions of a task instance and thus contain the required information to build up the task worklist. The method always executes the query for the user who is currently logged in and returns texts in the locale which is set for the user.
Set<TaskAbstract> myTasks = taskInstanceManager.getMyTaskAbstracts(statuses);
Typically, before displaying a start execution UI, the task should be claimed and its execution should be started.
To create a task execution UI, more data is needed than is provided by a TaskAbstract. You need to get the TaskDetail. This can be done by using the ID of a task instance. The TaskDetail contains thorough information about the task.
URI taskInstanceId = myTask.getId(); TaskDetail taskDetail = taskInstanceManager.getTaskDetail(taskInstanceId);
The TaskDetail can be used to obtain the input and output data of the task. The input and output data is represented by a data object.
DataObject taskInput = taskDetail.getInputDataObject(); DataObject taskOutput = taskDetail.getOutputDataObject();
The taskInput data object can now be used to read the initial task data and the taskOutput data object to write the result of the task execution. For more information about accessing the data objects, refer to the Service Data Objects (SDO) standard. An arbitrary UI Technology can be used for the task execution UI.
After the execution of the task, it can be completed with the (modified) output data.