From dcb735c5e3199f920f906343c3e2d94f21038d5d Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 26 Jul 2006 11:19:55 +0000 Subject: [PATCH] Merged V1.3 to HEAD (3247:3249, 3250:3280, 3281:3324) svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3247 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3249 . svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3250 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3280 . svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3281 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3324 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3411 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../AsynchronousActionExecutionQueueImpl.java | 24 +++++- .../action/executer/MailActionExecuter.java | 2 +- .../repo/coci/CheckOutCheckInServiceImpl.java | 16 ++-- .../repo/domain/hibernate/Node.hbm.xml | 4 +- .../repo/rule/RuleServiceCoverageTest.java | 86 +++++++++++++++++++ .../alfresco/repo/rule/RuleServiceImpl.java | 25 ++++-- .../repo/version/VersionServiceImpl.java | 3 + .../repo/version/VersionServicePolicies.java | 26 ++++++ .../repo/version/VersionableAspect.java | 52 +++++------ .../common/AbstractVersionServiceImpl.java | 19 ++++ 10 files changed, 208 insertions(+), 49 deletions(-) diff --git a/source/java/org/alfresco/repo/action/AsynchronousActionExecutionQueueImpl.java b/source/java/org/alfresco/repo/action/AsynchronousActionExecutionQueueImpl.java index aa49b4b72a..759ff5f72f 100644 --- a/source/java/org/alfresco/repo/action/AsynchronousActionExecutionQueueImpl.java +++ b/source/java/org/alfresco/repo/action/AsynchronousActionExecutionQueueImpl.java @@ -21,7 +21,9 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import org.alfresco.repo.rule.RuleServiceImpl; import org.alfresco.repo.security.authentication.AuthenticationComponent; +import org.alfresco.repo.transaction.AlfrescoTransactionSupport; import org.alfresco.repo.transaction.TransactionUtil; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ActionServiceException; @@ -105,11 +107,14 @@ public class AsynchronousActionExecutionQueueImpl extends ThreadPoolExecutor imp * org.alfresco.service.cmr.action.Action, boolean, * org.alfresco.service.cmr.repository.NodeRef) */ - public void executeAction(RuntimeActionService actionService, Action action, NodeRef actionedUponNodeRef, + @SuppressWarnings("unchecked") + public void executeAction(RuntimeActionService actionService, Action action, NodeRef actionedUponNodeRef, boolean checkConditions, Set actionChain, NodeRef actionExecutionHistoryNodeRef) { + Set executedRules = + (Set) AlfrescoTransactionSupport.getResource("RuleServiceImpl.ExecutedRules"); execute(new ActionExecutionWrapper(actionService, transactionService, authenticationComponent, action, - actionedUponNodeRef, checkConditions, actionExecutionHistoryNodeRef, actionChain)); + actionedUponNodeRef, checkConditions, actionExecutionHistoryNodeRef, actionChain, executedRules)); } /** @@ -176,6 +181,11 @@ public class AsynchronousActionExecutionQueueImpl extends ThreadPoolExecutor imp * The action chain */ private Set actionChain; + + /** + * List of executed list, helps to prevent loop scenarios with async rules + */ + private Set executedRules; /** * Constructor @@ -190,7 +200,7 @@ public class AsynchronousActionExecutionQueueImpl extends ThreadPoolExecutor imp */ public ActionExecutionWrapper(RuntimeActionService actionService, TransactionService transactionService, AuthenticationComponent authenticationComponent, Action action, NodeRef actionedUponNodeRef, - boolean checkConditions, NodeRef actionExecutionHistoryNodeRef, Set actionChain) + boolean checkConditions, NodeRef actionExecutionHistoryNodeRef, Set actionChain, Set executedRules) { this.actionService = actionService; this.transactionService = transactionService; @@ -200,6 +210,7 @@ public class AsynchronousActionExecutionQueueImpl extends ThreadPoolExecutor imp this.checkConditions = checkConditions; this.actionExecutionHistoryNodeRef = actionExecutionHistoryNodeRef; this.actionChain = actionChain; + this.executedRules = executedRules; } /** @@ -276,7 +287,12 @@ public class AsynchronousActionExecutionQueueImpl extends ThreadPoolExecutor imp new TransactionUtil.TransactionWork() { public Object doWork() - { + { + if (ActionExecutionWrapper.this.executedRules != null) + { + AlfrescoTransactionSupport.bindResource("RuleServiceImpl.ExecutedRules", ActionExecutionWrapper.this.executedRules); + } + ActionExecutionWrapper.this.actionService.executeActionImpl( ActionExecutionWrapper.this.action, ActionExecutionWrapper.this.actionedUponNodeRef, diff --git a/source/java/org/alfresco/repo/action/executer/MailActionExecuter.java b/source/java/org/alfresco/repo/action/executer/MailActionExecuter.java index 0bbc5b18b9..e3ff6e4590 100644 --- a/source/java/org/alfresco/repo/action/executer/MailActionExecuter.java +++ b/source/java/org/alfresco/repo/action/executer/MailActionExecuter.java @@ -216,7 +216,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase { if (personService.personExists(userAuth) == true) { - NodeRef person = personService.getPerson(authority); + NodeRef person = personService.getPerson(userAuth); String address = (String)nodeService.getProperty(person, ContentModel.PROP_EMAIL); if (address != null && address.length() != 0) { diff --git a/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java b/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java index ae961e7ca9..ae430ef149 100644 --- a/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java +++ b/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java @@ -307,9 +307,9 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService if (this.nodeService.hasAspect(workingCopyNodeRef, ContentModel.ASPECT_COPIEDFROM) == true) { // Disable versionable behaviours since we don't want the auto version policy behaviour to execute when we check-in - this.versionableAspect.disableAutoVersion(); - try - { + //this.versionableAspect.disableAutoVersion(); + //try + //{ Map workingCopyProperties = nodeService.getProperties(workingCopyNodeRef); // Try and get the original node reference nodeRef = (NodeRef) workingCopyProperties.get(ContentModel.PROP_COPY_REFERENCE); @@ -371,11 +371,11 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService // Re-lock the original node this.lockService.lock(nodeRef, LockType.READ_ONLY_LOCK); } - } - finally - { - this.versionableAspect.enableAutoVersion(); - } + //} + //finally + //{ + // this.versionableAspect.enableAutoVersion(); + //} } else diff --git a/source/java/org/alfresco/repo/domain/hibernate/Node.hbm.xml b/source/java/org/alfresco/repo/domain/hibernate/Node.hbm.xml index 51e8fb8fc6..72fe0ce91d 100644 --- a/source/java/org/alfresco/repo/domain/hibernate/Node.hbm.xml +++ b/source/java/org/alfresco/repo/domain/hibernate/Node.hbm.xml @@ -43,8 +43,8 @@ name="accessControlList" class="org.alfresco.repo.domain.hibernate.DbAccessControlListImpl" column="acl_id" - lazy="false" - fetch="join" + lazy="proxy" + fetch="select" unique="false" not-null="false" cascade="delete" /> diff --git a/source/java/org/alfresco/repo/rule/RuleServiceCoverageTest.java b/source/java/org/alfresco/repo/rule/RuleServiceCoverageTest.java index 284909b402..4ad3a46a20 100644 --- a/source/java/org/alfresco/repo/rule/RuleServiceCoverageTest.java +++ b/source/java/org/alfresco/repo/rule/RuleServiceCoverageTest.java @@ -1547,4 +1547,90 @@ public class RuleServiceCoverageTest extends TestCase throw new RuntimeException(exception); } } + + public void testAsyncExecutionWithPotentialLoop() + { + if (this.transformerRegistry.getTransformer(MimetypeMap.MIMETYPE_EXCEL, MimetypeMap.MIMETYPE_TEXT_PLAIN) != null) + { + try + { + Map params = new HashMap(1); + params.put(TransformActionExecuter.PARAM_MIME_TYPE, MimetypeMap.MIMETYPE_TEXT_PLAIN); + params.put(TransformActionExecuter.PARAM_DESTINATION_FOLDER, this.nodeRef); + params.put(TransformActionExecuter.PARAM_ASSOC_TYPE_QNAME, ContentModel.ASSOC_CONTAINS); + params.put(TransformActionExecuter.PARAM_ASSOC_QNAME, QName.createQName(TEST_NAMESPACE, "transformed")); + + Rule rule = createRule( + RuleType.INBOUND, + TransformActionExecuter.NAME, + params, + NoConditionEvaluator.NAME, + null); + rule.setExecuteAsynchronously(true); + rule.setTitle("Transform document to text"); + + UserTransaction tx0 = transactionService.getUserTransaction(); + tx0.begin(); + this.ruleService.saveRule(this.nodeRef, rule); + tx0.commit(); + + UserTransaction tx = transactionService.getUserTransaction(); + tx.begin(); + + Map props =new HashMap(1); + props.put(ContentModel.PROP_NAME, "test.xls"); + + // Create the node at the root + NodeRef newNodeRef = this.nodeService.createNode( + this.nodeRef, + ContentModel.ASSOC_CHILDREN, + QName.createQName(TEST_NAMESPACE, "origional"), + ContentModel.TYPE_CONTENT, + props).getChildRef(); + + // Set some content on the origional + ContentWriter contentWriter = this.contentService.getWriter(newNodeRef, ContentModel.PROP_CONTENT, true); + contentWriter.setMimetype(MimetypeMap.MIMETYPE_EXCEL); + File testFile = AbstractContentTransformerTest.loadQuickTestFile("xls"); + contentWriter.putContent(testFile); + + tx.commit(); + + Thread.sleep(10000); + //System.out.println(NodeStoreInspector.dumpNodeStore(this.nodeService, this.testStoreRef)); + + //AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent"); + //authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName()); + + // Check that the created node is still there + //List origRefs = this.nodeService.getChildAssocs( + // this.nodeRef, + // RegexQNamePattern.MATCH_ALL, QName.createQName(TEST_NAMESPACE, "origional")); + //assertNotNull(origRefs); + //assertEquals(1, origRefs.size()); + //NodeRef origNodeRef = origRefs.get(0).getChildRef(); + //assertEquals(newNodeRef, origNodeRef); + + // Check that the created node has been copied + //List copyChildAssocRefs = this.nodeService.getChildAssocs( + // this.rootNodeRef, + // RegexQNamePattern.MATCH_ALL, QName.createQName(TEST_NAMESPACE, "transformed")); + //assertNotNull(copyChildAssocRefs); + //assertEquals(1, copyChildAssocRefs.size()); + //NodeRef copyNodeRef = copyChildAssocRefs.get(0).getChildRef(); + //assertTrue(this.nodeService.hasAspect(copyNodeRef, ContentModel.ASPECT_COPIEDFROM)); + //NodeRef source = (NodeRef)this.nodeService.getProperty(copyNodeRef, ContentModel.PROP_COPY_REFERENCE); + //assertEquals(newNodeRef, source); + + // Check the transformed content + //ContentData contentData = (ContentData) nodeService.getProperty(copyNodeRef, ContentModel.PROP_CONTENT); + //assertEquals(MimetypeMap.MIMETYPE_TEXT_PLAIN, contentData.getMimetype()); + + } + catch (Exception exception) + { + throw new RuntimeException(exception); + } + } + } } diff --git a/source/java/org/alfresco/repo/rule/RuleServiceImpl.java b/source/java/org/alfresco/repo/rule/RuleServiceImpl.java index 4cda7352ec..a950e8a62d 100644 --- a/source/java/org/alfresco/repo/rule/RuleServiceImpl.java +++ b/source/java/org/alfresco/repo/rule/RuleServiceImpl.java @@ -653,12 +653,18 @@ public class RuleServiceImpl implements RuleService, RuntimeRuleService } } + /** + * @see org.alfresco.repo.rule.RuntimeRuleService#addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.rule.Rule) + */ @SuppressWarnings("unchecked") public void addRulePendingExecution(NodeRef actionableNodeRef, NodeRef actionedUponNodeRef, Rule rule) { addRulePendingExecution(actionableNodeRef, actionedUponNodeRef, rule, false); } + /** + * @see org.alfresco.repo.rule.RuntimeRuleService#addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.rule.Rule, boolean) + */ @SuppressWarnings("unchecked") public void addRulePendingExecution(NodeRef actionableNodeRef, NodeRef actionedUponNodeRef, Rule rule, boolean executeAtEnd) { @@ -684,7 +690,7 @@ public class RuleServiceImpl implements RuleService, RuntimeRuleService } } - // Prevent hte same rule being executed more than one in the same transaction + // Prevent the same rule being executed more than once in the same transaction pendingRules.add(pendingRuleData); } else @@ -707,7 +713,10 @@ public class RuleServiceImpl implements RuleService, RuntimeRuleService { logger.debug("Creating the executed rules list"); } - AlfrescoTransactionSupport.bindResource(KEY_RULES_EXECUTED, new HashSet()); + if (AlfrescoTransactionSupport.getResource(KEY_RULES_EXECUTED) == null) + { + AlfrescoTransactionSupport.bindResource(KEY_RULES_EXECUTED, new HashSet()); + } try { List executeAtEndRules = new ArrayList(); @@ -719,11 +728,11 @@ public class RuleServiceImpl implements RuleService, RuntimeRuleService } finally { - AlfrescoTransactionSupport.unbindResource(KEY_RULES_EXECUTED); - if (logger.isDebugEnabled() == true) - { - logger.debug("Unbinding resource"); - } + //AlfrescoTransactionSupport.unbindResource(KEY_RULES_EXECUTED); + //if (logger.isDebugEnabled() == true) + //{ + // logger.debug("Unbinding resource"); + // } } } @@ -900,7 +909,7 @@ public class RuleServiceImpl implements RuleService, RuntimeRuleService * * @author Roy Wetherall */ - private class ExecutedRuleData + public class ExecutedRuleData { protected NodeRef actionableNodeRef; diff --git a/source/java/org/alfresco/repo/version/VersionServiceImpl.java b/source/java/org/alfresco/repo/version/VersionServiceImpl.java index 198960bdec..933ebb4578 100644 --- a/source/java/org/alfresco/repo/version/VersionServiceImpl.java +++ b/source/java/org/alfresco/repo/version/VersionServiceImpl.java @@ -373,6 +373,9 @@ public class VersionServiceImpl extends AbstractVersionServiceImpl ContentModel.PROP_VERSION_LABEL, version.getVersionLabel()); + // Invoke the policy behaviour + invokeAfterCreateVersion(nodeRef, version); + // Return the data object representing the newly created version return version; } diff --git a/source/java/org/alfresco/repo/version/VersionServicePolicies.java b/source/java/org/alfresco/repo/version/VersionServicePolicies.java index b04086c1b3..60e01d32ef 100644 --- a/source/java/org/alfresco/repo/version/VersionServicePolicies.java +++ b/source/java/org/alfresco/repo/version/VersionServicePolicies.java @@ -46,11 +46,37 @@ public interface VersionServicePolicies } + /** + * After create version policy interface + * + */ + public interface AfterCreateVersionPolicy extends ClassPolicy + { + /** + * Called after the version has been created + * + * @param versionableNode the node that has been versioned + * @param version the created version + */ + public void afterCreateVersion(NodeRef versionableNode, Version version); + } + /** * On create version policy interface */ public interface OnCreateVersionPolicy extends ClassPolicy { + /** + * Called during the creation of the version to determine what the versioning policy for a + * perticular type may be. + * WARNING: implementing behaviour for this policy effects the versioning behaviour of the + * type the behaviour is registered against. + * + * @param classRef + * @param versionableNode + * @param versionProperties + * @param nodeDetails + */ public void onCreateVersion( QName classRef, NodeRef versionableNode, diff --git a/source/java/org/alfresco/repo/version/VersionableAspect.java b/source/java/org/alfresco/repo/version/VersionableAspect.java index 772727a481..5f02f6f558 100644 --- a/source/java/org/alfresco/repo/version/VersionableAspect.java +++ b/source/java/org/alfresco/repo/version/VersionableAspect.java @@ -46,14 +46,15 @@ import org.alfresco.service.namespace.QName; public class VersionableAspect implements ContentServicePolicies.OnContentUpdatePolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, - NodeServicePolicies.OnDeleteNodePolicy + NodeServicePolicies.OnDeleteNodePolicy, + VersionServicePolicies.AfterCreateVersionPolicy { /** The i18n'ized messages */ private static final String MSG_INITIAL_VERSION = "create_version.initial_version"; private static final String MSG_AUTO_VERSION = "create_version.auto_version"; /** Transaction resource key */ - private static final String KEY_INITIAL_VERSION = "initial_version_"; + private static final String KEY_VERSIONED_NODEREFS = "versioned_noderefs"; /** The policy component */ private PolicyComponent policyComponent; @@ -114,6 +115,10 @@ public class VersionableAspect implements ContentServicePolicies.OnContentUpdate QName.createQName(NamespaceService.ALFRESCO_URI, "onDeleteNode"), ContentModel.ASPECT_VERSIONABLE, new JavaBehaviour(this, "onDeleteNode", Behaviour.NotificationFrequency.TRANSACTION_COMMIT)); + this.policyComponent.bindClassBehaviour( + QName.createQName(NamespaceService.ALFRESCO_URI, "afterCreateVersion"), + ContentModel.ASPECT_VERSIONABLE, + new JavaBehaviour(this, "afterCreateVersion", Behaviour.NotificationFrequency.EVERY_EVENT)); autoVersionBehaviour = new JavaBehaviour(this, "onContentUpdate", Behaviour.NotificationFrequency.TRANSACTION_COMMIT); this.policyComponent.bindClassBehaviour( @@ -189,9 +194,6 @@ public class VersionableAspect implements ContentServicePolicies.OnContentUpdate Map versionDetails = new HashMap(1); versionDetails.put(Version.PROP_DESCRIPTION, I18NUtil.getMessage(MSG_INITIAL_VERSION)); this.versionService.createVersion(nodeRef, versionDetails); - - // Keep track of the fact that the initial version has been created - AlfrescoTransactionSupport.bindResource(KEY_INITIAL_VERSION + nodeRef.toString(), nodeRef); } } } @@ -210,12 +212,13 @@ public class VersionableAspect implements ContentServicePolicies.OnContentUpdate * * @param nodeRef the node reference */ - public void onContentUpdate(NodeRef nodeRef, boolean newContent) + @SuppressWarnings("unchecked") + public void onContentUpdate(NodeRef nodeRef, boolean newContent) { - if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE) == true) - { - // Determine whether we have already created an initial version during this transaction - if (AlfrescoTransactionSupport.getResource(KEY_INITIAL_VERSION + nodeRef.toString()) == null) + if (this.nodeService.exists(nodeRef) == true && this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE) == true) + { + Map versionedNodeRefs = (Map)AlfrescoTransactionSupport.getResource(KEY_VERSIONED_NODEREFS); + if (versionedNodeRefs == null || versionedNodeRefs.containsKey(nodeRef) == false) { // Determine whether the node is auto versionable or not boolean autoVersion = false; @@ -237,22 +240,19 @@ public class VersionableAspect implements ContentServicePolicies.OnContentUpdate } } } - + /** - * Enable the auto version behaviour - * + * @see org.alfresco.repo.version.VersionServicePolicies.OnCreateVersionPolicy#onCreateVersion(org.alfresco.service.namespace.QName, org.alfresco.service.cmr.repository.NodeRef, java.util.Map, org.alfresco.repo.policy.PolicyScope) */ - public void enableAutoVersion() - { - this.autoVersionBehaviour.enable(); - } - - /** - * Disable the auto version behaviour - * - */ - public void disableAutoVersion() - { - this.autoVersionBehaviour.disable(); - } + @SuppressWarnings("unchecked") + public void afterCreateVersion(NodeRef versionableNode, Version version) + { + Map versionedNodeRefs = (Map)AlfrescoTransactionSupport.getResource(KEY_VERSIONED_NODEREFS); + if (versionedNodeRefs == null) + { + versionedNodeRefs = new HashMap(); + AlfrescoTransactionSupport.bindResource(KEY_VERSIONED_NODEREFS, versionedNodeRefs); + } + versionedNodeRefs.put(versionableNode, versionableNode); + } } diff --git a/source/java/org/alfresco/repo/version/common/AbstractVersionServiceImpl.java b/source/java/org/alfresco/repo/version/common/AbstractVersionServiceImpl.java index 450891216b..9f8148ef20 100644 --- a/source/java/org/alfresco/repo/version/common/AbstractVersionServiceImpl.java +++ b/source/java/org/alfresco/repo/version/common/AbstractVersionServiceImpl.java @@ -26,6 +26,7 @@ import org.alfresco.repo.policy.ClassPolicyDelegate; import org.alfresco.repo.policy.PolicyComponent; import org.alfresco.repo.policy.PolicyScope; import org.alfresco.repo.version.VersionServicePolicies; +import org.alfresco.repo.version.VersionServicePolicies.AfterCreateVersionPolicy; import org.alfresco.repo.version.VersionServicePolicies.BeforeCreateVersionPolicy; import org.alfresco.repo.version.VersionServicePolicies.CalculateVersionLabelPolicy; import org.alfresco.repo.version.VersionServicePolicies.OnCreateVersionPolicy; @@ -68,6 +69,7 @@ public abstract class AbstractVersionServiceImpl * Policy delegates */ private ClassPolicyDelegate beforeCreateVersionDelegate; + private ClassPolicyDelegate afterCreateVersionDelegate; private ClassPolicyDelegate onCreateVersionDelegate; private ClassPolicyDelegate calculateVersionLabelDelegate; @@ -108,6 +110,7 @@ public abstract class AbstractVersionServiceImpl { // Register the policies this.beforeCreateVersionDelegate = this.policyComponent.registerClassPolicy(VersionServicePolicies.BeforeCreateVersionPolicy.class); + this.afterCreateVersionDelegate = this.policyComponent.registerClassPolicy(VersionServicePolicies.AfterCreateVersionPolicy.class); this.onCreateVersionDelegate = this.policyComponent.registerClassPolicy(VersionServicePolicies.OnCreateVersionPolicy.class); this.calculateVersionLabelDelegate = this.policyComponent.registerClassPolicy(VersionServicePolicies.CalculateVersionLabelPolicy.class); } @@ -127,6 +130,22 @@ public abstract class AbstractVersionServiceImpl this.beforeCreateVersionDelegate.get(nodeAspectQNames).beforeCreateVersion(nodeRef); } + /** + * Invoke the after create version policy bahaviour + * + * @param nodeRef the nodeRef versioned + * @param version the created version + */ + protected void invokeAfterCreateVersion(NodeRef nodeRef, Version version) + { + // invoke for node type + QName nodeTypeQName = nodeService.getType(nodeRef); + this.afterCreateVersionDelegate.get(nodeTypeQName).afterCreateVersion(nodeRef, version); + // invoke for node aspects + Set nodeAspectQNames = nodeService.getAspects(nodeRef); + this.afterCreateVersionDelegate.get(nodeAspectQNames).afterCreateVersion(nodeRef, version); + } + /** * Invoke the on create version policy behaviour *