Add proper merging of duplicate flownodes/userTasks to import scripts

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: L3 - Default
    • None
    • Affects Version/s: None
    • Component/s: backend
    • Not defined

      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

        This is the controller panel for Smart Panels app

              Assignee:
              Unassigned
              Reporter:
              Helene Waechtler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: