[SYNCOPE-1207] Refresh user object before working on it (as it could have been stored as workflow property)
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/220a9464 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/220a9464 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/220a9464 Branch: refs/heads/master Commit: 220a9464233cd9872ba6763fdf6f4fdf867d2581 Parents: 322bee2 Author: Francesco Chicchiriccò <ilgro...@apache.org> Authored: Mon Sep 18 12:42:41 2017 +0200 Committer: Francesco Chicchiriccò <ilgro...@apache.org> Committed: Mon Sep 18 12:42:41 2017 +0200 ---------------------------------------------------------------------- .../org/apache/syncope/core/workflow/flowable/task/Update.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/220a9464/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java ---------------------------------------------------------------------- diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java index 7f1c114..e9ed279 100644 --- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java +++ b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java @@ -24,6 +24,7 @@ import org.apache.syncope.common.lib.patch.PasswordPatch; import org.apache.syncope.common.lib.patch.UserPatch; import org.apache.syncope.common.lib.to.AttrTO; import org.apache.syncope.common.lib.to.UserTO; +import org.apache.syncope.core.persistence.api.dao.UserDAO; import org.apache.syncope.core.provisioning.api.PropagationByResource; import org.apache.syncope.core.persistence.api.entity.user.User; import org.apache.syncope.core.provisioning.api.data.UserDataBinder; @@ -37,6 +38,9 @@ public class Update extends AbstractFlowableServiceTask { @Autowired private UserDataBinder dataBinder; + @Autowired + private UserDAO userDAO; + @Override protected void doExecute(final String executionId) { User user = engine.getRuntimeService(). @@ -44,6 +48,7 @@ public class Update extends AbstractFlowableServiceTask { UserPatch userPatch = engine.getRuntimeService(). getVariable(executionId, FlowableUserWorkflowAdapter.USER_PATCH, UserPatch.class); + user = userDAO.save(user); UserTO original = dataBinder.getUserTO(user, true); PropagationByResource propByRes = dataBinder.update(user, userPatch);