[BONITA 6.2] closing one of the tasks that goes to a gateway after the other one has been submitted

Hi there,
I have got two tasks that are going to a gateway. Once one of the two has been submitted, I would like to close or submit the other one.

I tried adding a groovy connector to the task that comes after the gateway doing (without success) :

List hti=apiAccessor.processAPI.getHumanTaskInstances(processInstanceId, "Étape1", 0, 5); apiAccessor.processAPI.executeFlowNode(hti.get(0).getFlownodeDefinitionId());

Any idea ?
Thanks for any help.
Paul

I think this is what you are currently trying is:
Original diagram design
Issue with such diagram is that the Exclusive gateway (Gateway2) will let the process continue without aborting existing task (Exclusive gateway doesn’t do any check nor implement any logic). So you can end up in a situation where two instances of “Step C” are executed.

The solution I would suggest is to move the part with the gateway to a sub process that will finish with “terminate end event”. Compare to “end event” the main difference is that, once reach, such event terminate the process immediately killing all remaining tasks. So such design should cover your needs:
solution

That is exactly what I’m trying to do and I think that it should work. I will try it and keep you posted.

Thanks a lot !

Can you open another question that focus on this error about exchange of document between parent and sub-process?
Also in order to be able to help, can you share full log file content and the process you are using? You can use on online file sharing solution such as Dropbox or Google Drive.

Thanks

Hi there,
I tried it and it works perfectly with text variables.
My problem now is that I’m trying to do it with documents.
I looked on http://community.bonitasoft.com/answers/how-get-document-pool-subprocess but it returns me a DocumentNotFoundException.

Any ideas ?
Thanks
Paul