Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impersonate directive stops changes from saving #286

Open
AugustSvensson opened this issue Aug 10, 2023 · 1 comment
Open

Impersonate directive stops changes from saving #286

AugustSvensson opened this issue Aug 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@AugustSvensson
Copy link

AugustSvensson commented Aug 10, 2023

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 AugustSvensson added the bug Something isn't working label Aug 10, 2023
@AugustSvensson
Copy link
Author

AugustSvensson commented Aug 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant