RM-1021: It's possible to create record for synced content in folder with create record updated rule

* improve stability when defining update rules in collab site



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@56231 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-10-02 07:55:34 +00:00
parent b86621ce5c
commit 3f92fef4de
2 changed files with 44 additions and 32 deletions

View File

@@ -157,39 +157,42 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
@Override
public void executeRule(final Rule rule, final NodeRef nodeRef, final Set<ExecutedRuleData> executedRules)
{
QName typeQName = nodeService.getType(nodeRef);
// check if this is a rm rule on a rm artifact
if (filePlanService.isFilePlanComponent(nodeRef) == true &&
isFilePlanComponentRule(rule) == true)
if (nodeService.exists(nodeRef) == true)
{
// ignore and
if (isIgnoredType(typeQName) == false)
{
if (runAsRmAdmin == true)
{
// run as rmadmin
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
return null;
}
});
}
else
{
// run as current user
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
}
}
}
else
{
// just execute the rule as the current user
super.executeRule(rule, nodeRef, executedRules);
QName typeQName = nodeService.getType(nodeRef);
// check if this is a rm rule on a rm artifact
if (filePlanService.isFilePlanComponent(nodeRef) == true &&
isFilePlanComponentRule(rule) == true)
{
// ignore and
if (isIgnoredType(typeQName) == false)
{
if (runAsRmAdmin == true)
{
// run as rmadmin
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
return null;
}
});
}
else
{
// run as current user
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
}
}
}
else
{
// just execute the rule as the current user
super.executeRule(rule, nodeRef, executedRules);
}
}
}