disable flowNode / task

Hello,
I am new to Bonita and my company ask me to migrate a projet from bonita 5.2 to Bonita 6.5.
In this projet there are 3 differents lanes with 3 differents actors and many task interact with other actor task. In the old project it seem that, in a human/service task you could cancel or disable a different human task.
But cant find how to do that in Bonita 6.5. I find in Bonita portal, multiple differents tasks with the same case and processId.
When I try to use cancelProcessId, it s cancel all the tasks of that processId when I just want to cancel 1 task…

Anyone got a solution on how to cancel/destroy/disable a task from another task with the same processId ?

Thanks you,

Hi

There are two ways to go, I guess.

Do it programatically
I’m not sure but this seems to be a good solution:

import org.bonitasoft.engine.bpm.flownode.ActivityInstance;
import org.bonitasoft.engine.bpm.flownode.ActivityInstanceCriterion;
import org.bonitasoft.engine.bpm.flownode.ActivityStates

List activites = apiAccessor.getProcessAPI().getOpenActivityInstances(rootProcessInstanceId, 0, Integer.MAX_VALUE, ActivityInstanceCriterion.NAME_ASC)
long taskId = activites.find{ it.displayName == ‘Task name’ }.id
apiAccessor.getProcessAPI().setActivityStateByName(taskId, ActivityStates.CANCELLED_STATE)

Do it in diagram in BPMN style
Maybe consider using boundary events, that will interrupt execution of a task when an event from another arrives. Read about events here

Perfect,
I use the first method, save me from going crazy ^^
Thank you.