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

90837: Merged V4.2-BUG-FIX (4.2.5) to HEAD-BUG-FIX (5.0/Cloud)
      90751: Merged V4.2.4 (4.2.4) to V4.2-BUG-FIX (4.2.5)
         90739: Merged DEV to PATCHES/V4.2.4 (4.2.4)
            60205: MNT-9885: Rules not firing on some content saved in Alfresco drive
               - Incorrect RuleTrigger behavior is fixed. Rules that were ignored for content with sys:temporary aspect are now fired when this aspect is removed.
               - Required Unit tests were added.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94724 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 11:03:03 +00:00
parent 549257843e
commit 59acf9cab1
4 changed files with 128 additions and 18 deletions

View File

@@ -96,16 +96,19 @@ public class CreateNodeRuleTrigger extends RuleTriggerAbstractBase
new JavaBehaviour(this, POLICY));
}
// Register interest in the addition and removal of the sys:noContent aspect
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnAddAspectPolicy.QNAME,
ContentModel.ASPECT_NO_CONTENT,
new JavaBehaviour(this, "onAddAspect", NotificationFrequency.EVERY_EVENT));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnRemoveAspectPolicy.QNAME,
ContentModel.ASPECT_NO_CONTENT,
new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.EVERY_EVENT));
}
for (QName ignoreAspect : getIgnoredAspects())
{
// Register interest in the addition and removal of the sys:noContent aspect
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnAddAspectPolicy.QNAME,
ignoreAspect,
new JavaBehaviour(this, "onAddAspect", NotificationFrequency.EVERY_EVENT));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnRemoveAspectPolicy.QNAME,
ignoreAspect,
new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.EVERY_EVENT));
}
}
/**
* {@inheritDoc}
@@ -186,6 +189,10 @@ public class CreateNodeRuleTrigger extends RuleTriggerAbstractBase
" (this was triggered on removal of the noContent aspect)");
}
triggerRules(parentNodeRef, nodeRef);
// Do not trigger rules for rule and action type nodes
if (ignoreTrigger(nodeRef) == false)
{
triggerRules(parentNodeRef, nodeRef);
}
}
}