Merged 5.0.N (5.0.3) to HEAD (5.1)

109499: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.3)
      109403: Merged DEV to V4.2-BUG-FIX (4.2.6)
         109221 : MNT-12819 : InvalidNodeRefException - Node does not exist, if you call RuleService.removeAllRules(Node) for a folder which has INBOUND rules and OUTBOUND rules.
            - Added a check for existence of rule


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@109581 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-08-05 07:58:59 +00:00
parent f29c220c43
commit d16d3c4516
2 changed files with 119 additions and 8 deletions

View File

@@ -149,7 +149,8 @@ public class RuleTypeImpl extends CommonResourceAbstractBase implements RuleType
}
// Only queue if the rule is not disabled
if (rule.getRuleDisabled() == false && ruleService.rulesEnabled(ruleService.getOwningNodeRef(rule)))
boolean exists = nodeService.exists(rule.getNodeRef());
if (exists && rule.getRuleDisabled() == false && ruleService.rulesEnabled(ruleService.getOwningNodeRef(rule)))
{
if (logger.isDebugEnabled() == true)
{
@@ -168,7 +169,16 @@ public class RuleTypeImpl extends CommonResourceAbstractBase implements RuleType
}
else if (logger.isDebugEnabled() == true)
{
logger.debug("Disabled rule" + ruleContext);
String message = null;
if (exists)
{
message = "Disabled rule " + ruleContext;
}
else
{
message = "Rule " + rule.getNodeRef() + "no longer exist";
}
logger.debug(message);
}
}
}