Try to delete one of multi-instance task but nrOfActiveInstance didn't change.

hi, I’m trying to delete a task of multi-instance task with process instance modificatoin.cancelActivityInstance(). But I found nrOfActiveInstance didn’t change.
Did I use the right function? Or should I modify nrOfActiveInstance by myself?

Thanks for your help.

Hi @young , thank you for your question and welcome to the community. Have you checked that you are targeting the inner activity itself and not the multi-instance body? There is a good section in the docs on this topic:

The engine will take care of updating the variables associated with the multi-instance body such as nrOfActiveInstance, so you should not have to touch those. Could you share more of your modification code and maybe a snippet of your model too? This will help the community answer your question more quickly.

1 Like