Gareth Edwards
2013-01-23 09:28:13 UTC
Gareth Edwards [https://community.jboss.org/people/garethed] created the discussion
"Completing a human task with results"
To view the discussion, visit: https://community.jboss.org/message/793717#793717
--------------------------------------------------------------
Hi,
I can complete a human task using the TaskClient like so:
ContentData contentData = ContentMarshallerHelper.marshal(content, null);
       BlockingTaskOperationResponseHandler taskResponseHandler = new BlockingTaskOperationResponseHandler();
       client.complete(taskId, userId, contentData, taskResponseHandler);
       taskResponseHandler.waitTillDone(2000);
But how can I complete a task a get a result?
The TaskClient API has two complete methods:
*http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClient.html#complete(long, java.lang.String, org.jbpm.task.service.ContentData, org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler) complete*(long taskId, http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true String userId, http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/ContentData.html ContentData outputData, http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClientHandler.TaskOperationResponseHandler.html TaskClientHandler.TaskOperationResponseHandler responseHandler)
and
*http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClient.html#completeWithResults(long, java.lang.String, java.lang.Object, org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler) completeWithResults*(long taskId, http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true String userId, http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true Object results, http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClientHandler.TaskOperationResponseHandler.html TaskClientHandler.TaskOperationResponseHandler responseHandler)
I am using the first method as I need to pass in data on completion.
The second method appears to return results on completion but doesn't allow for passing in of content data.
How can I complete a human task with content data and get back a result?
Thanks in advance,
Gareth.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/793717#793717]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
"Completing a human task with results"
To view the discussion, visit: https://community.jboss.org/message/793717#793717
--------------------------------------------------------------
Hi,
I can complete a human task using the TaskClient like so:
ContentData contentData = ContentMarshallerHelper.marshal(content, null);
       BlockingTaskOperationResponseHandler taskResponseHandler = new BlockingTaskOperationResponseHandler();
       client.complete(taskId, userId, contentData, taskResponseHandler);
       taskResponseHandler.waitTillDone(2000);
But how can I complete a task a get a result?
The TaskClient API has two complete methods:
*http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClient.html#complete(long, java.lang.String, org.jbpm.task.service.ContentData, org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler) complete*(long taskId, http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true String userId, http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/ContentData.html ContentData outputData, http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClientHandler.TaskOperationResponseHandler.html TaskClientHandler.TaskOperationResponseHandler responseHandler)
and
*http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClient.html#completeWithResults(long, java.lang.String, java.lang.Object, org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler) completeWithResults*(long taskId, http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true String userId, http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true Object results, http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/service/TaskClientHandler.TaskOperationResponseHandler.html TaskClientHandler.TaskOperationResponseHandler responseHandler)
I am using the first method as I need to pass in data on completion.
The second method appears to return results on completion but doesn't allow for passing in of content data.
How can I complete a human task with content data and get back a result?
Thanks in advance,
Gareth.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/793717#793717]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]