- Rule and action tasks for 1.4

- Updated W/S include paths

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3526 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2006-08-16 13:27:35 +00:00
parent 895935e8d6
commit 29beac8efb
16 changed files with 501 additions and 193 deletions

View File

@@ -56,6 +56,12 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
/** The dictionary service */
protected DictionaryService dictionaryService;
/**
* Indicates whether the rule should be executed immediately or at the end of the transaction.
* By default this is false as all rules are executed at the end of the transaction.
*/
protected boolean executeRuleImmediately = false;
/**
* Set the policy component
*
@@ -96,6 +102,17 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
this.dictionaryService = dictionaryService;
}
/**
* Sets the values that indicates whether the rule should be executed immediately
* or not.
*
* @param executeRuleImmediately true execute the rule immediaely, false otherwise
*/
public void setExecuteRuleImmediately(boolean executeRuleImmediately)
{
this.executeRuleImmediately = executeRuleImmediately;
}
/**
* Registration of an interested rule type
*/
@@ -117,7 +134,7 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
{
for (RuleType ruleType : this.ruleTypes)
{
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef);
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef, this.executeRuleImmediately);
}
}
}

View File

@@ -35,7 +35,6 @@ public class RuleTriggerTest extends BaseSpringTest
{
private static final String ON_CREATE_NODE_TRIGGER = "on-create-node-trigger";
private static final String ON_UPDATE_NODE_TRIGGER = "on-update-node-trigger";
private static final String ON_DELETE_NODE_TRIGGER = "on-delete-node-trigger";
private static final String ON_CREATE_CHILD_ASSOCIATION_TRIGGER = "on-create-child-association-trigger";
private static final String ON_DELETE_CHILD_ASSOCIATION_TRIGGER = "on-delete-child-association-trigger";
private static final String ON_CREATE_ASSOCIATION_TRIGGER = "on-create-association-trigger";
@@ -287,7 +286,7 @@ public class RuleTriggerTest extends BaseSpringTest
return "displayLabel";
}
public void triggerRuleType(NodeRef nodeRef, NodeRef actionedUponNodeRef)
public void triggerRuleType(NodeRef nodeRef, NodeRef actionedUponNodeRef, boolean executeRuleImmediately)
{
// Indicate that the rules have been triggered
this.rulesTriggered = true;