aggregator-cli icon indicating copy to clipboard operation
aggregator-cli copied to clipboard

Impersonate directive stops changes from saving

Open AugustSvensson opened this issue 2 years ago • 1 comments

Steps to reproduce

Use .impersonate=onBehalfOfInitiator directive and do any field change in a rule. Run with aggregator 1.2

Expected behavior

Aggregator should save the changes.

Actual behavior

The impersonate directive clears the ChangedBy field then set it back to the original value again thus resetting the IsDirty flag for the workitem so nothing is saved.

IsDirty flag should probably be set to Changes.Any()

Diagnostic logs

Environment

Custom wrapper around the aggregator engine code.

AugustSvensson avatar Aug 10 '23 14:08 AugustSvensson

Noticed that this unwanted feature is two fold:

  1. Impersonate will always set a value to it's original value, thus removing the change entirely.
  2. If the last change you do is set a value back to the original value it will flag the workitem as not IsDirty and not save anything regardless if other values should be changed.

Impersonate happens after the rule execution and thus will make 2 happen.

AugustSvensson avatar Aug 10 '23 17:08 AugustSvensson