mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/V3.4 to HEAD (to fix ALF-5837)
23478: ALF-5303: Upload new version fails when file uploaded to sub-folder and parent folder has rule for update git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@24245 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -73,7 +73,8 @@ public class SimpleWorkflowActionExecuter extends ActionExecuterAbstractBase
|
|||||||
Action ruleAction,
|
Action ruleAction,
|
||||||
NodeRef actionedUponNodeRef)
|
NodeRef actionedUponNodeRef)
|
||||||
{
|
{
|
||||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||||
|
this.nodeService.hasAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW) == false)
|
||||||
{
|
{
|
||||||
// Get the parameter values
|
// Get the parameter values
|
||||||
String approveStep = (String)ruleAction.getParameterValue(PARAM_APPROVE_STEP);
|
String approveStep = (String)ruleAction.getParameterValue(PARAM_APPROVE_STEP);
|
||||||
|
@@ -1044,17 +1044,24 @@ public class RuleServiceImpl
|
|||||||
* @see org.alfresco.repo.rule.RuleService#executePendingRules()
|
* @see org.alfresco.repo.rule.RuleService#executePendingRules()
|
||||||
*/
|
*/
|
||||||
public void executePendingRules()
|
public void executePendingRules()
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled() == true)
|
|
||||||
{
|
|
||||||
logger.debug("Creating the executed rules list");
|
|
||||||
}
|
|
||||||
if (AlfrescoTransactionSupport.getResource(KEY_RULES_EXECUTED) == null)
|
if (AlfrescoTransactionSupport.getResource(KEY_RULES_EXECUTED) == null)
|
||||||
{
|
{
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug("Creating the executed rules list");
|
||||||
|
}
|
||||||
AlfrescoTransactionSupport.bindResource(KEY_RULES_EXECUTED, new HashSet<ExecutedRuleData>());
|
AlfrescoTransactionSupport.bindResource(KEY_RULES_EXECUTED, new HashSet<ExecutedRuleData>());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
List<PendingRuleData> executeAtEndRules = new ArrayList<PendingRuleData>();
|
{
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug("Executed rules list already exists");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PendingRuleData> executeAtEndRules = new ArrayList<PendingRuleData>();
|
||||||
executePendingRulesImpl(executeAtEndRules);
|
executePendingRulesImpl(executeAtEndRules);
|
||||||
for (PendingRuleData data : executeAtEndRules)
|
for (PendingRuleData data : executeAtEndRules)
|
||||||
{
|
{
|
||||||
|
@@ -21,13 +21,17 @@ package org.alfresco.repo.rule.ruletrigger;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.repo.action.ActionModel;
|
||||||
import org.alfresco.repo.policy.PolicyComponent;
|
import org.alfresco.repo.policy.PolicyComponent;
|
||||||
|
import org.alfresco.repo.rule.RuleModel;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.repository.ContentService;
|
import org.alfresco.service.cmr.repository.ContentService;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.rule.RuleType;
|
import org.alfresco.service.cmr.rule.RuleType;
|
||||||
|
import org.alfresco.service.namespace.QName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rule trigger abstract base
|
* Rule trigger abstract base
|
||||||
@@ -151,9 +155,27 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
|
|||||||
*/
|
*/
|
||||||
protected void triggerRules(NodeRef nodeRef, NodeRef actionedUponNodeRef)
|
protected void triggerRules(NodeRef nodeRef, NodeRef actionedUponNodeRef)
|
||||||
{
|
{
|
||||||
for (RuleType ruleType : this.ruleTypes)
|
// Do not trigger rules for rule and action type nodes
|
||||||
{
|
if (ignoreTrigger(actionedUponNodeRef) == false)
|
||||||
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef, this.executeRuleImmediately);
|
{
|
||||||
}
|
for (RuleType ruleType : this.ruleTypes)
|
||||||
|
{
|
||||||
|
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef, this.executeRuleImmediately);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean ignoreTrigger(NodeRef actionedUponNodeRef)
|
||||||
|
{
|
||||||
|
boolean result = false;
|
||||||
|
QName typeQName = nodeService.getType(actionedUponNodeRef);
|
||||||
|
if (typeQName.equals(RuleModel.TYPE_RULE) == true ||
|
||||||
|
typeQName.equals(ActionModel.TYPE_ACTION) == true ||
|
||||||
|
typeQName.equals(ActionModel.TYPE_COMPOSITE_ACTION) == true ||
|
||||||
|
typeQName.equals(ContentModel.TYPE_THUMBNAIL) == true)
|
||||||
|
{
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user