Hi guys,
I built a simple helper method to execute modification + migration in one step
@Transactional
public void caseToTaskMigration(String processInstanceId, String sourceActId, String targetActId, String sourceProcDefId, String targetProcDefId){
this.runtimeService.createProcessInstanceModification(processInstanceId)
.cancelAllForActivity(sourceActId)
.execute(true, true);
MigrationPlan migrationPlan = this.runtimeService.createMigrationPlan(sourceProcDefId, targetProcDefId)
.mapEqualActivities()
.build();
this.runtimeService.newMigration(migrationPlan).processInstanceIds(processInstanceId).execute();
this.runtimeService.createProcessInstanceModification(processInstanceId)
.startBeforeActivity(targetActId)
.execute();
}
Unfortunately if I execute this method the migration steps failed with following error.
Process instance contains not migrated incidents: [3479450e-8c22-11e9-a465-005056a17feb]
This incident is assigned to activity I canceled in first modification step.
But it seems that migration does not know about result of modification when it is executed in same transaction.
Is it possible to execute it is same transaction?
If I execute modification via rest it works fine but it would be much more manuals steps
Best regards,
Markus