<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding a rule to a folder in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55358#M33250</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to add the following rule to a folder using WebServices:&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;When some content (placed at this folder, let's call it folder Â«AÂ») is checked out, the working copy must be placed at another folder (let's call it Â«BÂ»).&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN&gt;but i don't see how&amp;nbsp; &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ops:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know even if what I'm trying to achieve is possible since I don't see any condition that indicates "checked-out content".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can i retrieve the working copy and move it to the desired folder?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It could be nice either if content could have an aspect applied telling it has been approved so it could be moved to another folder… Is it possible to create this new aspect? How could it be used as condition?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestion will be much appreciated…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enrique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Dec 2006 15:06:24 GMT</pubDate>
    <dc:creator>doblek</dc:creator>
    <dc:date>2006-12-27T15:06:24Z</dc:date>
    <item>
      <title>Adding a rule to a folder</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55358#M33250</link>
      <description>Hi all,I'm trying to add the following rule to a folder using WebServices:When some content (placed at this folder, let's call it folder Â«AÂ») is checked out, the working copy must be placed at another folder (let's call it Â«BÂ»).but i don't see how&amp;nbsp; &lt;IMG id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ops:I don't know even if what I'm trying to a</description>
      <pubDate>Wed, 27 Dec 2006 15:06:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55358#M33250</guid>
      <dc:creator>doblek</dc:creator>
      <dc:date>2006-12-27T15:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a rule to a folder</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55359#M33251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am aslo trying to add a rule using webservice, but I am confronted (again) with the lack of documentation…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So sorry, I can't really help you at the moment, but I hope someone else will &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found a sample for creating a rule :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;// Create the action&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NamedValue[] parameters = new NamedValue[]{new NamedValue("aspect-name", false, Constants.ASPECT_CLASSIFIABLE, null)};&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Action newAction = new Action();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newAction.setActionName("add-features");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newAction.setParameters(parameters);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create the rule&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule newRule = new Rule();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newRule.setRuleTypes(new String[]{"incomming"});&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newRule.setTitle("This rule adds the classificable aspect");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newRule.setAction(newAction);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Save the rule&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule[] saveResults1 = this.actionService.saveRules(BaseWebServiceSystemTest.contentReference, new Rule[]{newRule});&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;It looks simple, but I didn't manage to find a file where all the constants enum (like ActionName, RuleType etc…) are repertoried. It looks like it's hard written in the code on each class &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anybody can explain us where to find the possible constants values?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samuel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 16:58:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55359#M33251</guid>
      <dc:creator>sam69</dc:creator>
      <dc:date>2006-12-27T16:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a rule to a folder</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55360#M33252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Samuel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, documentation about adding rules through "web services" is still little and sometimes leads to some mistakes (for example, there is an atribute for conditions and actions â€”called "ID"â€” that is supposed to be read-only, but whenever you want to create a condition or an action, you have to write something in it if you don't want to get an error…)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't find those constants you were searching in any file, so I wrote a code to get some info about them… (Sorry, traces are in Spanish, but I think you can get it right… If don't, let me know, and I translate them for you)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Actions&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;ActionItemDefinition[] actions = WebServiceFactory.getActionService().getActionDefinitions();&lt;BR /&gt;trace += "Existen "+ actions.length + " definiciones de acciones.&amp;lt;BR&amp;gt;";&lt;BR /&gt;for (int j=0; j&amp;lt;=(actions.length-1); j++){&lt;BR /&gt;trace += "DefiniciÃ³n("+j+"): "+actions[j].getName() + " | " + actions[j].getType().toString()+"&amp;lt;BR&amp;gt;";&lt;BR /&gt;}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Conditions&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;ActionItemDefinition[] conditions = WebServiceFactory.getActionService().getConditionDefinitions();&lt;BR /&gt;trace += "Existen "+ conditions.length + " definiciones de condiciones.&amp;lt;BR&amp;gt;";&lt;BR /&gt;for (int j=0; j&amp;lt;=(conditions.length-1); j++){&lt;BR /&gt;trace += "DefiniciÃ³n("+j+"): "+conditions[j].getName() + " | " + conditions[j].getType().toString() + "&amp;lt;BR&amp;gt;";&lt;BR /&gt;}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Rule types&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;RuleType[] array = WebServiceFactory.getActionService().getRuleTypes();&lt;BR /&gt;trace += "Existen "+ array.length + " tipos de reglas:&amp;lt;BR&amp;gt;";&lt;BR /&gt;for (int j=0; j&amp;lt;=(array.length-1); j++){&lt;BR /&gt;trace += "Regla("+j+"): "+array[j].getName() + " | " + array[j].getDisplayLabel()+"&amp;lt;BR&amp;gt;";&lt;BR /&gt;}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;And this is what I got:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Actions&lt;/STRONG&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Existen 15 definiciones de acciones.&lt;BR /&gt;DefiniciÃ³n(0): transform | action&lt;BR /&gt;DefiniciÃ³n(1): script | action&lt;BR /&gt;DefiniciÃ³n(2): copy | action&lt;BR /&gt;DefiniciÃ³n(3): add-features | action&lt;BR /&gt;DefiniciÃ³n(4): link-category | action&lt;BR /&gt;DefiniciÃ³n(5): simple-workflow | action&lt;BR /&gt;DefiniciÃ³n(6): mail | action&lt;BR /&gt;DefiniciÃ³n(7): import | action&lt;BR /&gt;DefiniciÃ³n(8): extract-metadata | action&lt;BR /&gt;DefiniciÃ³n(9): check-out | action&lt;BR /&gt;DefiniciÃ³n(10): remove-features | action&lt;BR /&gt;DefiniciÃ³n(11): check-in | action&lt;BR /&gt;DefiniciÃ³n(12): specialise-type | action&lt;BR /&gt;DefiniciÃ³n(13): transform-image | action&lt;BR /&gt;DefiniciÃ³n(14): move | action&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Conditions&lt;/STRONG&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Existen 6 definiciones de condiciones.&lt;BR /&gt;DefiniciÃ³n(0): compare-property-value | condition&lt;BR /&gt;DefiniciÃ³n(1): in-category | condition&lt;BR /&gt;DefiniciÃ³n(2): no-condition | condition&lt;BR /&gt;DefiniciÃ³n(3): has-aspect | condition&lt;BR /&gt;DefiniciÃ³n(4): compare-mime-type | condition&lt;BR /&gt;DefiniciÃ³n(5): is-subtype | condition&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Rule types&lt;/STRONG&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Existen 3 tipos de reglas:&lt;BR /&gt;Regla(0): update | Update&lt;BR /&gt;Regla(1): outbound | Outbound&lt;BR /&gt;Regla(2): inbound | Inbound&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I've already found that example &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; In fact, I've been using it in order to get my rule running, but still no success…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying to insert a rule in a folder that adds versionable aspect to the all content created in it or uploaded to it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;//Condition&lt;BR /&gt;trace += "Trying to create the condition…";&lt;BR /&gt;Condition condition = new Condition();&lt;BR /&gt;condition.setId("1");&lt;BR /&gt;condition.setConditionName("is-subtype");&lt;BR /&gt;condition.setInvertCondition(false);&lt;BR /&gt;condition.setParameters(new NamedValue[]{new NamedValue("is-subtype", false, Constants.TYPE_CONTENT, null)});&lt;BR /&gt;trace += "Done!&amp;lt;BR&amp;gt;";&lt;BR /&gt;&lt;BR /&gt;//Action&lt;BR /&gt;trace += "Trying to create the action…";&lt;BR /&gt;NamedValue[] parameters = new NamedValue[]{new NamedValue("aspect-name", false, Constants.ASPECT_VERSIONABLE, null)};&lt;BR /&gt;Action cvs_action = new Action();&lt;BR /&gt;cvs_action.setId("1");&lt;BR /&gt;cvs_action.setActionName("add-features");&lt;BR /&gt;cvs_action.setActionReference(folder_ref);&lt;BR /&gt;cvs_action.setParameters(parameters);&lt;BR /&gt;cvs_action.setConditions(new Condition[]{condition});&lt;BR /&gt;trace += "Done!&amp;lt;BR&amp;gt;";&lt;BR /&gt;&lt;BR /&gt;//Rule&lt;BR /&gt;trace += "Trying to create the rule…";&lt;BR /&gt;Rule cvs_rule = new Rule();&lt;BR /&gt;cvs_rule.setRuleTypes(new String[]{"Inbound"});&lt;BR /&gt;cvs_rule.setTitle("Versioning");&lt;BR /&gt;cvs_rule.setDescription("All content in this folder has \"Version History\"");&lt;BR /&gt;cvs_rule.setRuleReference(folder_ref);&lt;BR /&gt;cvs_rule.setAction(cvs_action);&lt;BR /&gt;trace += "Done!&amp;lt;BR&amp;gt;";&lt;BR /&gt;&lt;BR /&gt;//Saving rule&lt;BR /&gt;trace += "Trying to save the rule…";&lt;BR /&gt;WebServiceFactory.getActionService().saveRules(folder_ref, new Rule[]{cvs_rule});&lt;BR /&gt;trace += "Done!&amp;lt;BR&amp;gt;";&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;But it crashes saying:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="color: red;"&gt;ERROR: org.xml.sax.SAXException: Invalid element in org.alfresco.repo.webservice.action.Rule - ruleReference&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea about why I can't save this rule against that node reference??&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anybody see what I'm doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enrique&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS: sorry for my English&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Dec 2006 15:01:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55360#M33252</guid>
      <dc:creator>doblek</dc:creator>
      <dc:date>2006-12-28T15:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a rule to a folder</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55361#M33253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've managed at last to create a rule in folder that adds versionable aspect to the content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem was a little bit strange… I was using Alfresco 1.3 (because I couldn't upgrade to 1.4 &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ops: ) and "web-service-client.jar" from 1.4. Until this moment, I didn't have any particular or big problem using web services; but "Action", "Condition" and "Rule" classes from "org.alfresco.webservice.action" package in version 1.4 are very different from those same classes in version 1.3. So I've downgraded the "web-service-client" library and it seems to work &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem now setting the condition to the rule… The rule is saved against the proper folder and the action is well performed (I've tested this removing the condition), but when I try to create new content specifying the condition it says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[size=75]&lt;/SPAN&gt;&lt;SPAN style="color:red;"&gt;Please correct the errors below then click Finish. &lt;BR /&gt;A system error happened during the operation: Transaction didn't commit: A value for the mandatory parameter type has not been set on the rule item is-subtype &lt;/SPAN&gt;&lt;SPAN&gt;[/size]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I made a mistake with the condition parameter… but I'm not sure… Does anybody know how should I say to Alfresco that I want to apply this rule only to those items in folder which are "content"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the code I'm using actually:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;//Condition&lt;BR /&gt;Condition condition = new Condition();&lt;BR /&gt;condition.setId("1");&lt;BR /&gt;condition.setConditionName("is-subtype");&lt;BR /&gt;condition.setInvertCondition(false);&lt;BR /&gt;condition.setParameters(new NamedValue[]{new NamedValue("is-subtype", false, Constants.TYPE_CONTENT, null)});&lt;BR /&gt;//Action&lt;BR /&gt;NamedValue[] parameters = new NamedValue[]{new NamedValue("aspect-name", false, Constants.ASPECT_VERSIONABLE, null)};&lt;BR /&gt;Action cvs_action = new Action();&lt;BR /&gt;cvs_action.setId("1");&lt;BR /&gt;cvs_action.setActionName("add-features");&lt;BR /&gt;cvs_action.setTitle("Add version to content");&lt;BR /&gt;cvs_action.setDescription("This action will add versionable aspect to every content in the folder, so every file will have version history");&lt;BR /&gt;cvs_action.setExecuteAsynchronously(false);&lt;BR /&gt;cvs_action.setReference(published_folder);&lt;BR /&gt;cvs_action.setParameters(parameters);&lt;BR /&gt;//Rule&lt;BR /&gt;Rule cvs_rule = new Rule();&lt;BR /&gt;cvs_rule.setRuleType("inbound");&lt;BR /&gt;cvs_rule.setTitle("Versioning");&lt;BR /&gt;cvs_rule.setDescription("All content in this folder has \"Version History\"");&lt;BR /&gt;cvs_rule.setReference(published_folder);&lt;BR /&gt;cvs_rule.setConditions(new Condition[]{condition});&lt;BR /&gt;cvs_rule.setActions(new Action[]{cvs_action});&lt;BR /&gt;//Saving rule&lt;BR /&gt;WebServiceFactory.getActionService().saveRules(published_folder, new Rule[]{cvs_rule});&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestion appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enrique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jan 2007 18:14:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55361#M33253</guid>
      <dc:creator>doblek</dc:creator>
      <dc:date>2007-01-03T18:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a rule to a folder</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55362#M33254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a similar issue, in that I use a rule to specialize the content type, which has a versionable as a mandatory aspect (inherited from a more general doc type).&amp;nbsp; I believe that the problem is that an initial Version is not being set due to the way that the aspect is being applied to the content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The content is created and specialized correctly, and can even be read but changes to the content result in the same error you appear to be seeing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I get a solution, I'll let you know.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jan 2007 12:49:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55362#M33254</guid>
      <dc:creator>jgreen</dc:creator>
      <dc:date>2007-01-09T12:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a rule to a folder</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55363#M33255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I've finally been successful in adding the rule to the space… &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem was (as I supposed) that I was making a mistake when creating the condition to the rule…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you have decided the action/condition you want to run by setting the ActionName or ConditionName (chosing one from the list I write here in a former post), you have to create the parameters that are needed for that specific action/condition carefully. That is: the number of parameters, the parameterName and parameterValue are specific for the action/condition chosen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a little bit hard and wide to describe all the parameters for each action/condition, but I could try to help anyone if I'm asked… &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; Maybe I could try to write a doc and send it to an admin (that revises it and publishes it in the wiki), but I do not have too much time &lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://connect.hyland.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I'm having problems with IDs… I don't trust in the solution I've reached… But I've started &lt;/SPAN&gt;&lt;A href="http://forums.alfresco.com/viewtopic.php?t=4826" rel="nofollow noopener noreferrer"&gt;another thread in the forum&lt;/A&gt;&lt;SPAN&gt; and maybe someone can give us insight on that matter…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally, this is the code that worked for me (adds a rule that gives versionable aspect to every content created in a folder):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;//UUID objects&lt;BR /&gt;UUID condition_id = UUID.randomUUID();&lt;BR /&gt;UUID action_id = UUID.randomUUID();&lt;BR /&gt;//Condition&lt;BR /&gt;Condition condition = new Condition();&lt;BR /&gt;condition.setId(condition_id.toString());&lt;BR /&gt;condition.setConditionName("is-subtype");&lt;BR /&gt;condition.setInvertCondition(false);&lt;BR /&gt;condition.setParameters(new NamedValue[]{new NamedValue("type", false, Constants.TYPE_CONTENT, null)});&lt;BR /&gt;//Action&lt;BR /&gt;NamedValue[] parameters = new NamedValue[]{new NamedValue("aspect-name", false, Constants.ASPECT_VERSIONABLE, null)};&lt;BR /&gt;Action cvs_action = new Action();&lt;BR /&gt;cvs_action.setId(action_id.toString());&lt;BR /&gt;cvs_action.setActionName("add-features");&lt;BR /&gt;cvs_action.setTitle("Add version to content");&lt;BR /&gt;cvs_action.setDescription("This action will add versionable aspect to every content in the folder, so every file will have version history");&lt;BR /&gt;cvs_action.setExecuteAsynchronously(false);&lt;BR /&gt;cvs_action.setReference(published_folder);&lt;BR /&gt;cvs_action.setParameters(parameters);&lt;BR /&gt;//Rule&lt;BR /&gt;Rule cvs_rule = new Rule();&lt;BR /&gt;cvs_rule.setRuleType("inbound");&lt;BR /&gt;cvs_rule.setTitle("Versioning");&lt;BR /&gt;cvs_rule.setDescription("All content in this folder has \"Version History\"");&lt;BR /&gt;cvs_rule.setReference(published_folder);&lt;BR /&gt;cvs_rule.setConditions(new Condition[]{condition});&lt;BR /&gt;cvs_rule.setActions(new Action[]{cvs_action});&lt;BR /&gt;//Saving rule&lt;BR /&gt;WebServiceFactory.getActionService().saveRules(published_folder, new Rule[]{cvs_rule});&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enrique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jan 2007 18:02:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-rule-to-a-folder/m-p/55363#M33255</guid>
      <dc:creator>doblek</dc:creator>
      <dc:date>2007-01-09T18:02:55Z</dc:date>
    </item>
  </channel>
</rss>

