JBoss Community

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

created by Mdu Keswa in jBPM Development - View the full discussion

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

Start a new discussion in jBPM Development at Community