03-19-2014 09:23 AM
org.alfresco.error.AlfrescoRuntimeException: 02190269 Rules with non-composite actions are not currently supported by the UI
public boolean createVersionableRule() {
boolean status = true;
try {
Action action = new Action();
action.setActionName("add-features");
Condition[] conditions = new Condition[1];
Condition condition = new Condition();
condition.setConditionName("no-condition");
conditions[0] = condition;
action.setConditions(conditions);
NamedValue namedValue = new NamedValue();
namedValue.setName("aspect-name");
namedValue.setValue(Constants.ASPECT_VERSIONABLE);
NamedValue[] namedValues = new NamedValue[1];
namedValues[0] = namedValue;
action.setParameters(namedValues);
Rule[] rules = new Rule[1];
Rule rule = new Rule();
rule.setAction(action);
rule.setTitle("Add versionable aspect");
rule.setDescription("Add the versionable aspect to all the items inthe space");
rule.setExecuteAsynchronously(false);
rule.setRuleTypes(new String[]{"inbound"});
rules[0] = rule;
Reference reference = new Reference(CMSUtil.SPACE_STORE, CMSUtil.getCompanyHomeUUID(), CMSUtil.DEFAULT_COMPANY_HOME_NAME);
Rule[] resultList = WebServiceFactory.getActionService().saveRules(reference, rules);
if(resultList!=null && resultList.length>0) {
Reference owningReference = resultList[0].getOwningReference();
Reference ruleReference = resultList[0].getRuleReference();
log.debug("owningReference " + owningReference.getUuid());
log.debug("ruleReference " + ruleReference.getUuid());
}
} catch(Exception e) {
status = false;
log.error("problem in creating versionable rule", e);
}
return status;
}
03-19-2014 10:10 AM
Action compositeAction = new Action();
compositeAction.setActionName("composite-action");
Action action = new Action();
action.setActionName("add-features");
Condition[] conditions = new Condition[1];
Condition condition = new Condition();
condition.setConditionName("no-condition");
conditions[0] = condition;
action.setConditions(conditions);
NamedValue namedValue = new NamedValue();
namedValue.setName("aspect-name");
namedValue.setValue(Constants.ASPECT_VERSIONABLE);
NamedValue[] namedValues = new NamedValue[1];
namedValues[0] = namedValue;
action.setParameters(namedValues);
Action actions[]= new Action[1];
actions[0]=action;
compositeAction.setActions(actions);
Rule[] rules = new Rule[1];
Rule rule = new Rule();
rule.setAction(compositeAction);
rule.setTitle("Add versionable aspect");
rule.setDescription("Add the versionable aspect to all the items inthe space");
03-20-2014 05:51 AM
03-20-2014 08:53 AM
03-20-2014 09:06 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.