on 01-14-2013 5:23 PM
Hi Gurus. i have developed a BPM process that uses a subprocess, everything works fine, the process starts , assigns tasks and execute correctly the subprocess.
My problem is the following: I'm developing a WebService and im using the BPM API to know where the task is where in status "Ready", "Reserved" or in "Progress" for each process (The principal), when the active task is in the principal process my webservice works fine and i can see the task, but when it is in a subprocess I can’t find it.
I wrote this code to find tasks, like i have only the "process instance" for the principal process, passed this in the method signature:
protected String getCurrentTaskName(String strProcesInstance) throws CustomException{
String taskActualName = "";
try {
// create URI
URI uriProcessInstanceId = new URI(strProcesInstance);
//Define Statuses
HashSet<Status> statuses = new HashSet<Status>();
statuses.add(Status.READY);
statuses.add(Status.RESERVED);
statuses.add(Status.IN_PROGRESS);
// Get Task Instance manager
TaskInstanceManager taskInstanceManager = BPMFactory.getTaskInstanceManager();
// Get Task abtract
Set<TaskAbstract> taskAbstracts = taskInstanceManager.getTaskAbstractsByParent(uriProcessInstanceId, statuses);
// Get Task name
for (TaskAbstract taskAbstract : taskAbstracts)
taskActualName = taskAbstract.getName();
} catch (Exception e) {
throw new CustomException("Unable to get the current task", e);
}
return taskActualName;
}
For example given this process instance :36d6c9852a8411e2bfb30000009421ae , Of browse in the Manage Process, its seems like this:
When select "Show Related Task", can see task for process and subprocess ("Mostrar_Resultado" is a task of subprocess):.
Did you know how i can get the current task for sub-process with BPM API?.
Basically I'm looking for ways to get the "process instance" of a sub-process started by another process, with which I can reuse the same method and get the tasks
Best Regards.
Hi everybody
I was reviewing this issue directly with SAP staff, and this was the answer:
Dear Ramiro, et al,
unfortunately the desired functionality cannot implemented with the currently available API. There is no possibility to navigate from a process instance to its parent or even root instance.
However, there are options to implement this:
We actually plan to ship this functionality as part of the BPM API with SAP NetWeaver BPM 7.3.1, SP8 which is planned to be available in Q3 this year. There you will be able to obtain the parent and root for a certain process instance programmatically.
I hope this information can help you in your implementation .
Best regards,
I hope this information can help you in your implementation.
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.