<!–***************************–>
<!–* Preparateur de document *–>
<!–***************************–>
<bean id="lpr-prepare-document" class="lpr.alfresco.repo.PrepareDocument" parent="action-executer" >
<property name="nodeService">
<ref bean="nodeService" />
</property>
<property name="permissionService">
<ref bean="permissionService" />
</property>
<!–property name="fileFolderService">
<ref bean="FileFolderService" />
</property–>
<!–property name="contentService">
<ref bean="contentService" />
</property–>
</bean>
Rule rule = new Rule();
rule.setRuleType("inbound");
// setup the rule and add it to the space
rule.setTitle("Document Preparator (In)");
rule.setDescription("Prepare new document imported in repository");
rule.applyToChildren(true);
rule.setExecuteAsynchronously(true);
rule.setRuleDisabled(false);
CompositeAction compositeAction = actionService.createCompositeAction();
rule.setAction(compositeAction);
compositeAction.addAction(actionService.createAction("lpr-prepare-document"));
compositeAction.addActionCondition(actionService.createActionCondition("no-condition"));
ruleService.saveRule(nodeRef, rule);
compositeAction.addActionCondition(actionService.createActionCondition("no-condition"));
compositeAction.addActionCondition(actionService.createActionCondition("is-subtype"));
Il faut utiliser la seconde méthode createActionCondition, celle qui permet de passer une map de paramètres pour construire la condition. Tu peux alors spécifier le type qui t'intéresse (param "type", voir classe IsSubTypeEvaluator).
Rule rule = new Rule();
rule.setRuleType("inbound");
// setup the rule and add it to the space
rule.setTitle("Processus Space Creator (In)");
rule.setDescription("Make Processus Space");
rule.applyToChildren(false);
rule.setExecuteAsynchronously(false);
rule.setRuleDisabled(false);
CompositeAction compositeAction = actionService.createCompositeAction();
rule.setAction(compositeAction);
compositeAction.addAction(actionService.createAction("lpr-make-processus-space"));
//compositeAction.addActionCondition(actionService.createActionCondition("no-condition"));
Map<String,Serializable> actionMap = new HashMap<String, Serializable>();
actionMap.put("type", ContentModel.TYPE_FOLDER);
compositeAction.addActionCondition(actionService.createActionCondition("is-subtype",actionMap));
ruleService.saveRule(nodeRef, rule);
<!–*********************************–>
<!–* Createur d'arborescence *–>
<!–*********************************–>
<bean id="lpr-make-processus-space" class="lpr.alfresco.repo.MakeProcessusSpace" parent="action-executer" >
<property name="nodeService">
<ref bean="nodeService" />
</property>
<property name="fileFolderService">
<ref bean="FileFolderService" />
</property>
<property name="ruleService">
<ref bean="RuleService" />
</property>
<property name="actionService">
<ref bean="ActionService" />
</property>
</bean>
<bean id="lpr-make-processus-space-action-messages" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco/messages/action-executer/lpr-make-processus-space-action-messages</value>
</list>
</property>
</bean>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.