Flowable alter flow does not trigger task listener

hi all,

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?

Hey @blueboy85,

Currently the task listeners are not invoked when performing the state changes. The idea of the task listeners is to be invoked during the normal execution of the process flow. If you need to execute some logic during the migration you’ll need to do it manually.

Cheers,
Filip