cancel
Showing results for 
Search instead for 
Did you mean: 

Identifying Predecessors

se040
Champ in-the-making
Champ in-the-making
Hi all,

I want to know if there is a way (i know there is no way in the API of the engine atm) to identify the type and id of the predecessor of a task, knowing the process instance and task id of course.

I am glad for any help.


Regards,
Stefan
2 REPLIES 2

se040
Champ in-the-making
Champ in-the-making
OK after a bit exploring i found a kind of solution by using BpmnParse-Class.

For whom it may interest: I just had to "fake" a Deployment to make it work. Just create a new BPMN-Parse like this:

new BpmnParse = new BpmnParse(new BpmnParser(new ExpressionManager(), new DefaultBpmnParseFactory()))

When using in Tests or elsewhere also make sure that Context.getProcessEngineConfiguration is not null. I first used the Parse in a JUnit Test with an Activity Rule and got a NullPointer. So i just set the Configuration with the static setter.

Now I can at least identify possible predecessors and successors, but by checking active tasks before and after completion the new created follow-ups can be identified (ok, not if you have parallel multi-instance sub processes but I dont have them) =D

jbarrez
Star Contributor
Star Contributor
Another path you could take is to fetch the BpmnModel representation of the process definition. There you can easily traverse the different steps in the process in a pojo way.