Details
-
Task
-
Resolution: Unresolved
-
L3 - Default
-
None
-
None
-
Not defined
Description
Context:
Currently, our userTask and flowNode writers group existing flowNodes by id (userTaskInstanceId or flowNodeInstanceId, depending on the type). To resolve a previous issue with duplicate keys, a simple merge function was added. See this example from CompletedActivityInstanceWriter:
"(...) ctx._source.${flowNodesField}.stream()(...).collect(Collectors.toMap(n -> n.${flowNodeInstanceIdField}, n -> n, (n1, n2) -> n1));"
However, it might be possible that duplicate userTasks have different data, depending on where they've come from. If this is the case, we risk losing data when this "(n1, n2) -> n1" merge happens. Instead, we should merge all duplicate userTasks into one userTask that preserves all data. Note that we first need to evaluate if/how we can determine which data needs preserved. For some fields, eg "assignee", this might not be very straight forward and may involve some more elaborate logic.
Also make sure to evaluate if this is required only for userTasks or also for other flowNodes.
AT:
- All userTask and activity import scripts merge potential duplicates in a sensible manner rather than just selecting one of them
mgm-controller-panel
This is the controller panel for Smart Panels app
Attachments
Issue Links
- is related to
-
OPT-3869 Resolve potential duplicate key exceptions from process instance upserts
- Done