Reverse merged 5.2.N (5.2.1)

136820 mmuller: MNT-15365 Forbid pending rule applying on working copies. Added test.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@136833 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Martin Muller
2017-05-22 09:24:43 +00:00
parent eeb40852b4
commit d8f90ea98d
2 changed files with 50 additions and 76 deletions

View File

@@ -151,11 +151,6 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
{ {
return; return;
} }
// MNT-15365 No rule applying on working copies
if (nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY))
{
return;
}
// Do not trigger rules for rule and action type nodes // Do not trigger rules for rule and action type nodes
if (ignoreTrigger(actionedUponNodeRef) == false) if (ignoreTrigger(actionedUponNodeRef) == false)
{ {

View File

@@ -133,27 +133,6 @@ public class RuleTriggerTest extends BaseSpringTest
assertTrue(ruleType.rulesTriggered); assertTrue(ruleType.rulesTriggered);
} }
// MNT-15365
public void testOnUpdateNodeTriggerOnWorkingCopy()
{
NodeRef nodeRef = this.nodeService.createNode(
this.rootNodeRef,
ContentModel.ASSOC_CHILDREN,
ContentModel.ASSOC_CHILDREN,
ContentModel.TYPE_CONTAINER).getChildRef();
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY, null);
TestRuleType ruleType = createTestRuleType(ON_UPDATE_NODE_TRIGGER);
assertFalse(ruleType.rulesTriggered);
// Try and trigger the type
this.nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, "nameChanged");
// Check to see if the rule type has been triggered. It shouldn't trigger because it is a working copy
assertFalse(ruleType.rulesTriggered);
}
// public void testOnDeleteNodeTrigger() // public void testOnDeleteNodeTrigger()
// { // {
// NodeRef nodeRef = this.nodeService.createNode( // NodeRef nodeRef = this.nodeService.createNode(