- Action/Rule decoupling work

- Updated web services, SDK and web client where appropraite
- Patch added to migrate existing rules
- Entire rule service can now be disabled programmatically
- Rule service is now disabled during the patching process
- StoreEnum and languageEnum types removed from web service interfaces
- Multiple rule types now supported in the repo (but not in the UI)
- Removed owning node ref from action and rule .. now calculated from methods on the rule service

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3464 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2006-08-07 15:53:45 +00:00
parent a4e8facbae
commit cbe407f6b1
4 changed files with 73 additions and 20 deletions

View File

@@ -19,6 +19,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionCondition;
import org.alfresco.service.cmr.action.ActionConditionDefinition;
import org.alfresco.service.cmr.action.CompositeAction;
import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.service.cmr.rule.Rule;
import org.alfresco.service.cmr.rule.RuleService;
@@ -100,7 +101,9 @@ public class CreateRuleWizard extends BaseActionWizard
Node currentSpace = this.browseBean.getActionSpace();
// create the new rule
Rule rule = this.ruleService.createRule(this.getType());
//Rule rule = this.ruleService.createRule(this.getType());
Rule rule = new Rule();
rule.setRuleType(this.getType());
// setup the rule
outcome = setupRule(context, rule, outcome);
@@ -203,6 +206,21 @@ public class CreateRuleWizard extends BaseActionWizard
{
return "error_rule";
}
protected CompositeAction getCompositeAction(Rule rule)
{
// Get the composite action
Action ruleAction = rule.getAction();
if (ruleAction == null)
{
throw new AlfrescoRuntimeException("Rule does not have associated action.");
}
else if ((ruleAction instanceof CompositeAction) == false)
{
throw new AlfrescoRuntimeException("Rules with non-composite actions are not currently supported by the UI");
}
return (CompositeAction)ruleAction;
}
// ------------------------------------------------------------------------------
// Bean Getters and Setters
@@ -651,6 +669,9 @@ public class CreateRuleWizard extends BaseActionWizard
rule.applyToChildren(this.applyToSubSpaces);
rule.setExecuteAsynchronously(this.runInBackground);
CompositeAction compositeAction = this.actionService.createCompositeAction();
rule.setAction(compositeAction);
// add all the conditions to the rule
for (Map<String, Serializable> condParams : this.allConditionsProperties)
{
@@ -674,7 +695,7 @@ public class CreateRuleWizard extends BaseActionWizard
Boolean not = (Boolean)condParams.get(BaseConditionHandler.PROP_CONDITION_NOT);
condition.setInvertCondition(((Boolean)not).booleanValue());
rule.addActionCondition(condition);
compositeAction.addActionCondition(condition);
}
// add all the actions to the rule
@@ -696,7 +717,7 @@ public class CreateRuleWizard extends BaseActionWizard
// add the action to the rule
Action action = this.actionService.createAction(actionName);
action.setParameterValues(repoActionParams);
rule.addAction(action);
compositeAction.addAction(action);
}
return outcome;