Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-5256

Add proper merging of duplicate flownodes/userTasks to import scripts

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • L3 - Default
    • None
    • None
    • backend
    • 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

            Activity

              People

                Unassigned Unassigned
                helene.waechtler Helene Waechtler
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Salesforce