Created a process as StartEvent -> UserTask1 -> EndEvent.
Started two process instances (do not complete the userTasks)
Do no complete the userTasks and let Optimize import the existing instances.
Created a new process as StartEvent -> NewUserTask -> UserTask1 -> EndEvent.
Migrated my existing processes to the new version, and mapped UserTask1 from the first process to NewUserTask.
The result was cockpit correctly showing 2 tokens in NewUserTask, but Optimize showed 0 in NewUserTask and 2 in UserTask1.
Process definition migration is not covered by Optimize.
Also note that we now store definition information (ID and version in particular) that will need adjusted after a process instance migration (see PR comment: https://github.com/camunda/camunda-optimize/pull/3751#issuecomment-890734884 )
Notes from testing:
- if Optimize imports instances for the first time after migration, the data is correct in Optimize (when all or version 2 is selected, instances are shown in NewUserTask. If version 1 is selected, no instances are shown)
- if Optimize imports the data for the first time before migration, then again after migration (eg because the userTasks are completed and the instances complete the process), we see 2 instances in NewUserTask and 2 instances in userTask1 which imo is correct.
- If version 2 is start --> userTask1 --> newUserTask --> end and the instances are imported again after migation (due to completion of userTasks as described in the point above), the data is also shown correctly, though this could be confusing as there is a "gap" in the heatmap: 2 instances in start, 0 in userTask1, 2 instances in newUserTask.
- Additional observed issue (#1): confusingly, I also observed inconsistencies in the startEvent. Selecting "all" versions I see 2 instances in start. Selecting either version 1 or version 2, or "always display latest", there are 0 instances in start. selecting both version 1 and 2 there are 2 instances in start.
- Looking at ES, I can see that both instances have a startEvent, but the startEvent flownode entry within the instances has definitionVersion 1 whereas the definitionVersion of the instance is 2, which is probably causing the above - will need to clarify expected behaviour.
- Additional observed issue (#2): when I create a heatmap report with "all versions" selected before the deployment of version 2, the heatmap xml is not updated to reflect version 2 once version 2 is deployed unless I enter version selection again and select any other option and then back to "all versions". Note, the xml preview in the version selection modal is correct.
- Additional observed issue (#3) regarding assignee data. In the scenario that an userTask1 is assigned pre migration, the data in Optimize is inconsistent until the process instance is imported again (due to its completion). Until then, we see a similar issue as with the startEvent above: if I select version 1, the userTask report shows demo assignee for userTask1 (which is technically correct? although inconsistent as the process instance is now version 2 and should be filtered out), if I select version 2, there are no results (no buckets for either task or assignee). "all" version shows both tasks and the demo assignee for userTask1.
Once the instance is completed and reimported, the data changes: newUserTask bucket now has the demo assignee and there is no assignee in the userTask1 bucket. The results make sense but can be temporarily confusing.
This ticket was migrated to github: https://github.com/camunda/camunda-optimize/issues/10806. Please use this link for any future references and continue any discussion there.