RuntimeService.createModification for mutiple process definition

Hi,

I am trying to use a batch modification of process, using createModification method of RuntimeService API.
Scenario is: My process consists of 100 process instances, say 25 instances are in latest version (“myProcessDefinitionId2”) of deployment and rest 75 are in previous version (“myProcessDefinitionId1”) , hence having different process definition id.
I want to use below code for all the instances only once:

runtimeService.createModification()
.startBeforeActivity(“UserTask3”)
.cancelAllForActivity(“UserTask1”)
.cancelAllForActivity(“UserTask2”)
.processInstanceIds(processInstanceIdList).setAnnotation(“bulk update”)
.execute();
(processInstanceIdList is ArrayList consisting all the processInstance ids)

Could not find the solution for that.