[jboss-user] [jBPM] - Re: How get completed/release time for a task?
José Luis Granda
do-not-reply at jboss.com
Sat Jun 25 22:07:56 EDT 2011
José Luis Granda [http://community.jboss.org/people/jlgranda81] created the discussion
"Re: How get completed/release time for a task?"
To view the discussion, visit: http://community.jboss.org/message/611985#611985
--------------------------------------------------------------
Thanks Nick for the idea, I will try it.
About retrieve content data, you can use JBPM BlockingGetContentResponseHandler pass contentId, that is useful for retrieve any content in the task. Then you can cast the byte array to object and cast to map for explore variables by one by.
protected Content getTaskContent(Long contentId) {
BlockingGetContentResponseHandler responseHandler = new BlockingGetContentResponseHandler();
client.getContent(contentId, responseHandler);
return responseHandler.getContent();
}
protected Object getTaskContentAsObject(Long contentId) {
Object objectReturn = null;
byte[] buf = getTaskContent(contentId).getContent();
// Do something with the data read here
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
try {
ObjectInputStream is = new ObjectInputStream(bais);
boolean okRead = false;
// Map map = new LinkedHashMap<String, Object>();
while (!okRead && (objectReturn = is.readObject()) != null) {
okRead = true;
System.out.println("getTaskContentAsObject object: "
+ objectReturn);
}
} catch (Exception e) {
System.err
.print("There was an error reading content task input...");
e.printStackTrace();
}
return objectReturn;
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/611985#611985]
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/20110625/645212ef/attachment.html
More information about the jboss-user
mailing list