-
1. Re: How to use Content of Human Task
eaa Feb 28, 2012 8:45 AM (in response to devilkazuya99)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,
-
2. Re: How to use Content of Human Task
calca Feb 28, 2012 10:37 AM (in response to devilkazuya99)1 of 1 people found this helpfulAdding to Esteban's response.
If you need more than one variable in your task, you can avoid using Content variable, and use the variables mappings of the task node.
When you execute the code Esteban posted, you will receive a map with these variables.
Regards,
Demian
-
3. Re: How to use Content of Human Task
devilkazuya99 Feb 29, 2012 1:23 AM (in response to calca)Thank you guys for your reply. I know about variables mappings, just that I don't want to leave the Content there without knowing what it can do.