Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

59881: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3)
      59606: Merged DEV to V4.2-BUG-FIX
         58106: Fixed formatting in MailActionExecuter found during investigations
         58107: Fixed formatting issues in ActionExecuterAbstractBase found during investigations
         58108: Further detection of transaction state in the base action code (MNT-9806)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62197 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-12 08:11:23 +00:00
parent dc3d804dfe
commit ad6ffbde8c
2 changed files with 67 additions and 60 deletions

View File

@@ -24,6 +24,8 @@ import java.util.Set;
import org.alfresco.repo.action.ActionDefinitionImpl;
import org.alfresco.repo.action.ParameterizedItemAbstractBase;
import org.alfresco.repo.lock.LockUtils;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
@@ -236,6 +238,11 @@ public abstract class ActionExecuterAbstractBase extends ParameterizedItemAbstra
*/
public void execute(Action action, NodeRef actionedUponNodeRef)
{
if (AlfrescoTransactionSupport.getTransactionReadState() == TxnReadState.TXN_NONE)
{
throw new IllegalStateException("Actions invariably access the repository. Doing so without a transaction is not recommended.");
}
// Check the mandatory properties
checkMandatoryProperties(action, getActionDefinition());