-
1. TaskClient (Parameter mapping - Result mapping)
sasir Apr 7, 2011 11:05 AM (in response to lgimenez)Yes you can transfer complex data types as well..You just have to type cast it as below and you can read the paramter values from that
HashMap taskinfo1=new HashMap();
BlockingGetContentResponseHandler handlerC = new BlockingGetContentResponseHandler();
client.getContent(taskData.getDocumentContentId(), handlerC);
Content content = handlerC.getContent();
if (content != null){
ByteArrayInputStream bais = new ByteArrayInputStream(content.getContent());
ObjectInputStream ois;
try {
ois = new ObjectInputStream(bais);
taskinfo1 =(HashMap) ois.readObject();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
-
2. TaskClient (Parameter mapping - Result mapping)
lgimenez Apr 7, 2011 11:47 AM (in response to sasir)Hi Sasi, thanks for your answer.
I tried your solution, but get an error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.HashMap.
What is the difference between Content field and parameter mapping properties in task human?
How can get the information of the parameters using taskClient?
Regards
Leandro
-
3. TaskClient (Parameter mapping - Result mapping)
fabiowg Apr 8, 2011 3:54 PM (in response to lgimenez)Hi,
I'm still trying to figure out some stuff about jbpm5, but here's what I've got so far concerning your question.
In order to insert the content data in a task, start a process (which has a variable declared "somevalue") passing the map of parameters populated with it (let's say params.put("somevalue", somevalue)), and the human task field "Content" (using the Properties view of eclipse) configured to be "#{somevalue}".
This 'somevalue' is (it seems) what is retrieved when you call client.getContent(taskData.getDocumentContentId(), handler).
-
4. Re: TaskClient (Parameter mapping - Result mapping)
bpmn2user Apr 8, 2011 10:16 PM (in response to fabiowg)Here is a simple example where parameters (using Map) are passed to human task.
http://community.jboss.org/people/bpmn2user/blog/2011/04/03/jbpm5-human-task-api-usage-example