Discussion:
[jboss-user] [jBPM] - How to get tasks based on a Process ID in jBPM5.3
Aadav N
2013-01-11 11:33:29 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"How to get tasks based on a Process ID in jBPM5.3"

To view the discussion, visit: https://community.jboss.org/message/790390#790390

--------------------------------------------------------------
Hi,

Is there any method to get the list of prospective tasks associated to a Processinstance..?

Thanks,
Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790390#790390]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-11 11:49:14 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to get tasks based on a Process ID in jBPM5.3"

To view the discussion, visit: https://community.jboss.org/message/790394#790394

--------------------------------------------------------------
A dedicated method for this was added 5.4: http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClient.html#getTasksByStatusByProcessId(long,%20java.util.List,%20java.lang.String,%20org.jbpm.task.service.TaskClientHandler.TaskSummaryResponseHandler) getTasksByStatusByProcessId

If you cannot upgrade to 5.4 then probably the only way is to use deprecated query method on taskClient as a workaround.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790394#790394]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-01-11 14:52:12 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: How to get tasks based on a Process ID in jBPM5.3"

To view the discussion, visit: https://community.jboss.org/message/790435#790435

--------------------------------------------------------------
Post by Maciej Swiderski
A dedicated method for this was added 5.4: http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClient.html#getTasksByStatusByProcessId(long,%20java.util.List,%20java.lang.String,%20org.jbpm.task.service.TaskClientHandler.TaskSummaryResponseHandler) getTasksByStatusByProcessId
If you cannot upgrade to 5.4 then probably the only way is to use deprecated query method on taskClient as a workaround.
HTH
Thank you Maciejs..


Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790435#790435]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-11 14:50:45 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: How to get tasks based on a Process ID in jBPM5.3"

To view the discussion, visit: https://community.jboss.org/message/790434#790434

--------------------------------------------------------------
You can connect using a TaskClient and get the tasks using the method suggested above :


//Connect with the Human Task handler using the task client
//Create a list of status of the tasks you are interested in.
statusList.add(Status.Completed);
statusList.add(Status.Reserved);
statusList.add(Status.Ready);
 

 
client.getTasksByStatusByProcessId(processInstanceId,statusList, "en-UK", responseHandler);
List<TaskSummary> taskSummaryList = responseHandler.getResults();
for(TaskSummary taskSummary : taskSummaryList)
{
//retrieve the details
taskSummary.getId();
taskSummary.getName();
taskSummary.getCreatedOn();
taskSummary.getActualOwner();
taskSummary.getStatus();
}
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790434#790434]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-01-11 15:19:59 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: How to get tasks based on a Process ID in jBPM5.3"

To view the discussion, visit: https://community.jboss.org/message/790443#790443

--------------------------------------------------------------
Post by roxy1987
//Connect with the Human Task handler using the task client
//Create a list of status of the tasks you are interested in.
statusList.add(Status.Completed);
statusList.add(Status.Reserved);
statusList.add(Status.Ready);
client.getTasksByStatusByProcessId(processInstanceId,statusList, "en-UK", responseHandler);
List<TaskSummary> taskSummaryList = responseHandler.getResults();
*for*(TaskSummary taskSummary : taskSummaryList)
{
//retrieve the details
taskSummary.getId();
taskSummary.getName();
taskSummary.getCreatedOn();
taskSummary.getActualOwner();
taskSummary.getStatus();
}
Thank you roxy1987
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790443#790443]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...