Process Instance Modification fails on Event Subscription scenario

All,

I have a BPMN for Pizza Delivery. I’m doing POC on Process Instance Modification

image

Scenario 1: Saying that I’m having a token in “Order Completed” User task. Using my process instance modification business logic, I want to go to “Order Cancel” User Task.

Result for Scenario 1: As expected the request has been moved to “Order Cancel” User Task. , but in camunda cockpit console “Running Activity Instance” count i.e., blue badge icon was missing.

Scenario 2: Now here I’m trying to move a token from “Approve and Prepare Order” User Task to “Delivery” User Task with the same process instance modification business logic.

Result for Scenario 2: As expected the request has been moved to “Delivery” User Task and I could see the “Running Activity Instance” count in camunda cockpit console.

What did I observe is?
If the “User Task” is attached with the Message Event subscription then I’m encountering this scenario

My question is, I don’t know how to move the token if user task attached with the message event subscription.

Could anyone suggest to me what I’m missing :frowning_face:

My code snippet for process instance modification is below:

   runtimeService.createProcessInstanceModification(processInstanceId)
            .cancelAllForActivity(“orderCompleted”)
            .startBeforeActivity(“orderCancel).execute();

Much thanks in advance