Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-3442

Implicit variable updates are not reflected in history

      When an object variable is updated implicitly (e.g. by adding an object to a list without subsequent #setVariable call), the variable update is not propagated as a history event. The updated value is therefore not reflected in the history tables.

      General problem when fixing this:
      We don't know when an object is implicitly updated and therefore don't know the execution/activity instance id that is valid at that point in time. It could even be that this variable is not updated in the context of an activity at all but aside from it (e.g. in a custom command outside of an API call). So getting the history entirely right is impossible.

      Test case:
      https://github.com/camunda/camunda-bpm-platform/commit/412bb1c4ad8ae3c3e4ccb63fe633e8f6a5e795b0

        This is the controller panel for Smart Panels app

            [CAM-3442] Implicit variable updates are not reflected in history

            I removed the fix version from this for now.

            Daniel Meyer added a comment - I removed the fix version from this for now.

            fml2 added a comment -

            > We don't know when an object is implicitly updated and therefore don't know the execution/activity instance id that is valid at that point in time.

            A solution to this would be to check the serialized state of all objects in the variable scope after executing a delegate (each delegate, regardless of async points). This way it would be possible to collect a horrect history of variable changes (there might be several changes during one job).

            I understand that this is a very costly strategy, but there might be projects for which the correct automatic saving of variables is worth that. Maybe it would be good to introduce some strategy for finding out whether variables have chaged and make it configurable via the engine configuration.

            fml2 added a comment - > We don't know when an object is implicitly updated and therefore don't know the execution/activity instance id that is valid at that point in time. A solution to this would be to check the serialized state of all objects in the variable scope after executing a delegate (each delegate, regardless of async points). This way it would be possible to collect a horrect history of variable changes (there might be several changes during one job). I understand that this is a very costly strategy, but there might be projects for which the correct automatic saving of variables is worth that. Maybe it would be good to introduce some strategy for finding out whether variables have chaged and make it configurable via the engine configuration.

              smirnov Roman Smirnov
              thorben.lindhauer Thorben Lindhauer
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: