[jboss-user] [jBPM] - JBPM5 Task completion through API

npereira do-not-reply at jboss.com
Wed May 11 12:57:22 EDT 2011


npereira [http://community.jboss.org/people/npereira] created the discussion

"JBPM5 Task completion through API"

To view the discussion, visit: http://community.jboss.org/message/604788#604788

--------------------------------------------------------------
Hi forum,

I have an piece of java code that is completing the Tasks through the API.

But I have facing an issue, the ideia is that on completion of a task I complete it with a new set of parameteres.
For that matter I have to put the HashMap into the Content Object, and only then, complete the task.

Here is the problem, whenever I do this, either being throuh client.SetDocumentContent or client.complete, this new data never gets persisted to the following activity.

This is my code,

//Creates a new Content to Fit in the Task
HashMap newMap = new HashMap();
newMap.put("TFirst", 1234);
newMap.put("TSecond", "blabla");

Object newObj = (Object)newMap;

ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(newObj);
oos.flush(); 
oos.close(); 
bos.close();

byte[] newByteContent = bos.toByteArray ();
Content neWContent = new Content();
neWContent.setContent(newByteContent);

//Sets content on Task
client.setDocumentContent(task.getId(), neWContent, sresponseHandler);

//Completes the task                
BlockingTaskOperationResponseHandler qweresponseHandler = new BlockingTaskOperationResponseHandler();
ContentData cd = new ContentData(); 
cd.setContent(newByteContent);
client.complete(task.getId(), userID, cd, qweresponseHandler);

Am I missing something?

Best regards,
Nelson


--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110511/2b082d13/attachment.html 


More information about the jboss-user mailing list