I am having issues trying to perform an alter flow, where i intend to move the current active user task from user task A to user task B within the same process instance. I used the following code to achieve this:
ActivityMigrationMapping mapping = ActivityMigrationMapping.createMappingFor(taskDefinitionId, targetTaskId); ProcessInstance processInstance = runtimeService.createProcessInstanceQuery() .processInstanceId(processInstanceId).singleResult(); processMigrationService.createProcessInstanceMigrationBuilder() .migrateToProcessDefinition(processInstance.getProcessDefinitionId()) .addActivityMigrationMapping(mapping).migrate(processInstanceId);
I added task listeners (create event) to both user tasks, but it seems that the task listeners were not fired after migration. does anyone know whether i’m doing it correctly?