From d29cf7e0744fb78913b1b5a9170f67ab92055853 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 15 Feb 2006 14:03:39 +0000 Subject: [PATCH] The ActionServiceImpl was attempting to call a service method after an exception. - This didn't fail before because the actions didn't use the authenticated services but does now. - When an action fails, the service attempts to make it asynchronous, but requires some info in order to proceed. That info is now fetched upfront. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2385 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/repo/action/ActionServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/repo/action/ActionServiceImpl.java b/source/java/org/alfresco/repo/action/ActionServiceImpl.java index cf325d3c39..a16a2ceccb 100644 --- a/source/java/org/alfresco/repo/action/ActionServiceImpl.java +++ b/source/java/org/alfresco/repo/action/ActionServiceImpl.java @@ -365,6 +365,9 @@ public class ActionServiceImpl implements ActionService, RuntimeActionService, A logger.debug("Current action = " + action.getId()); } + // get the current user early in case the process fails and we are unable to do it later + String currentUserName = this.authenticationComponent.getCurrentUserName(); + if (actionChain == null || actionChain.contains(action.getId()) == false) { if (logger.isDebugEnabled() == true) @@ -432,7 +435,7 @@ public class ActionServiceImpl implements ActionService, RuntimeActionService, A if (compensatingAction != null) { // Set the current user - ((ActionImpl)compensatingAction).setRunAsUser(this.authenticationComponent.getCurrentUserName()); + ((ActionImpl)compensatingAction).setRunAsUser(currentUserName); // Queue the compensating action ready for execution this.asynchronousActionExecutionQueue.executeAction(this, compensatingAction, actionedUponNodeRef, false, null);