AnsweredAssumed Answered

global rule for adding versionable aspect to contents

Question asked by msj4u on Mar 19, 2014
Latest reply on Mar 20, 2014 by msj4u

i am using following code to create a rule in /app:company_home folder and on children spaces.

rule is created but is not executed as expected.

further more when i try to edit that rule from UI explorer it gives
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();
         Condition[] conditions = new Condition[1];
         Condition condition = new Condition();
         conditions[0] = condition;
         NamedValue namedValue = new NamedValue();
         NamedValue[] namedValues = new NamedValue[1];
         namedValues[0] = namedValue;
         Rule[] rules = new Rule[1];
         Rule rule = new Rule();
         rule.setTitle("Add versionable aspect");
         rule.setDescription("Add the versionable aspect to all the items inthe space");
         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;

can somebody help here ?