[jboss-dev-forums] [jBPM Development] - Re: How to retrieve unfinished tasks from process instance in jbpm 5

Mdu Keswa do-not-reply at jboss.com
Thu Jun 21 12:02:48 EDT 2012


Mdu Keswa [https://community.jboss.org/people/mduk] created the discussion

"Re: How to retrieve unfinished tasks from process instance in jbpm 5"

To view the discussion, visit: https://community.jboss.org/message/743451#743451

--------------------------------------------------------------
Pedro - we ended up doing the following. I feel like there definitely a better way as Mauricio suggested:

1. Find active nodes
2. Find all nodes after nodes in #1
3. Find all human nodes in #2


Notes on 1.:
ProcessInstanceLog processInstanceLog = jpaDbLog.findProcessInstance(new Long(instanceId))

Notes on 3.:
|  |  |  |  |  | while (node != null) { |
|  |  |  |  |  |  | if (node instanceof HumanTaskNode) { |
|  |  |  |  |  |  |  | list.add((HumanTaskNode)node); |
|  |  |  |  |  |  | } |
|  |  |  |  |  |  | connections = null; |
|  |  |  |  |  |  | connections = node.getOutgoingConnections("DROOLS_DEFAULT"); |
|  |  |  |  |  |  | if (connections != null && connections.size() > 0) { |
|  |  |  |  |  |  |  | node = node.getOutgoingConnections("DROOLS_DEFAULT").get(0).getTo(); |
|  |  |  |  |  |  | } else { |
|  |  |  |  |  |  |  | break; |
|  |  |  |  |  |  | } |
|  |  |  |  |  | } |


I hope this helps.
--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120621/9cad2a66/attachment.html 


More information about the jboss-dev-forums mailing list