Esteban Aliverti [
https://community.jboss.org/people/eaa] created the discussion
"Re: How to use Content of Human Task"
To view the discussion, visit:
https://community.jboss.org/message/720202#720202
--------------------------------------------------------------
In the process definition you have to map the "Content" input from a process
variable or a hardcoded value.
The content is not present in the TaskSummary object. In your client application, you have
to explicitly ask for the content:
public Object getTaskContentInput(TaskSummary taskSum) {
BlockingGetTaskResponseHandler handlerT = new
BlockingGetTaskResponseHandler();
client.getTask(taskSum.getId(), handlerT);
Task task2 = handlerT.getTask();
TaskData taskData = task2.getTaskData();
BlockingGetContentResponseHandler handlerC = new
BlockingGetContentResponseHandler();
client.getContent(taskData.getDocumentContentId(), handlerC);
Content content = handlerC.getContent();
ByteArrayInputStream bais = new ByteArrayInputStream(
content.getContent());
try {
ObjectInputStream is = new ObjectInputStream(bais);
Object obj = null;
while ((obj = is.readObject()) != null) {
System.out.println("OBJECT: " + obj);
return obj;
}
} catch (Exception e) {
System.err.print("There was an error reading task
input...");
e.printStackTrace();
return null;
}
return null;
}
Best Regards,
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/720202#720202]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]