<?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 Prevent rules propagation to parent folder in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53613#M19959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing an issue with rules triggering in Alfresco (Community v5.2.0 (r135134-b14) schema 10 005).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our installation, we are using the rules to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Communicate to other server components about what happens in Alfresco&lt;/LI&gt;&lt;LI&gt;Prevent unwanted actions (like deleting some folders)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We faced multiple issues and random behaviors that we fixed with a lot of checks in our JS code but one "unsolvable" case remains.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a rule that is used to prevent people to rename or delete folders with a name starting by "_" , this rule only applies to elements that have the custom property 'gofast&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;reventDelete' set to true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is : When we are doing something on an element in a folder starting by "_", the rules will trigger on the document but also on the parent folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exemple :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A delete request is called :&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;16:58:31,244 WebDAV request DELETE on path /alfresco/webdav/Sites/_Groups/_Var%20dump%20land/content%20(2).mp4&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Rules triggers on the document :&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;16:58:31,345 ==== STARTING SCRIPT SCRIPT SYNCHRONIZE ====&lt;BR /&gt;16:58:31,346 Script called on content (2).mp4 / 10651e68-7a35-4727-a1d1-f6e889805656&lt;BR /&gt;&lt;STRONG&gt;............................SOME ACTIONS..............................&lt;/STRONG&gt;&lt;BR /&gt;16:58:31,423 Request has been sent&lt;BR /&gt;16:58:31,423 Drupal answered OK&lt;BR /&gt;16:58:31,424 Closing XHR Object&lt;BR /&gt;16:58:31,424 ==== ENDING SCRIPT SCRIPT SYNCHRONIZE ====&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But just after this, the rule to prevent to delete a folder starting with '_' is&amp;nbsp;called, not on the document but on it's parent folder :&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;16:58:31,491 ==== STARTING SCRIPT SCRIPT PREVENT DELETE SPACE FOLDER ====&lt;BR /&gt;16:58:31,492 Script called on _Var dump land / eb8dc7e7-dd04-4a6a-8909-3c263e54e0e6&lt;BR /&gt;16:58:31,492 Edition of _Var dump land will lead to a crash.&lt;BR /&gt;16:58:31,492 Exception org.mozilla.javascript.JavaScriptException: ROLLBACK : Edition of a space folder is not authorized (workspace://SpacesStore/ca813b71-8f57-4057-8496-8a4d39ee3d63#17)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;And the transaction is rollbacked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you think it's possible to stop propagation in the first script ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2018 15:27:29 GMT</pubDate>
    <dc:creator>oshikaru</dc:creator>
    <dc:date>2018-04-17T15:27:29Z</dc:date>
    <item>
      <title>Prevent rules propagation to parent folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53613#M19959</link>
      <description>Hello !I'm facing an issue with rules triggering in Alfresco (Community v5.2.0 (r135134-b14) schema 10 005).In our installation, we are using the rules to:Communicate to other server components about what happens in AlfrescoPrevent unwanted actions (like deleting some folders)We faced multiple issue</description>
      <pubDate>Tue, 17 Apr 2018 15:27:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53613#M19959</guid>
      <dc:creator>oshikaru</dc:creator>
      <dc:date>2018-04-17T15:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent rules propagation to parent folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53614#M19960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using the "Items are deleted..." trigger and the "Execute script" action for your rule? I cannot recreate the case where a script gets called twice using that trigger and action for a simple, one-line script that just has a logger.debug statement in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe your script logic is triggering the rule twice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you considered using a lower-level behavior rather than a folder rule?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 18:27:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53614#M19960</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2018-04-23T18:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent rules propagation to parent folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53615#M19961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have 4 rules applied on the 'Sites' folder. All sub folders iherit of the parent folder rules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update aspects&lt;/STRONG&gt; : '&lt;SPAN style="color: #58595b; background-color: #ffffff;"&gt;Items are created or enter this folder&lt;/SPAN&gt;', execute a script to set some wanted custom aspects on items&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Synchronize&amp;nbsp;&lt;/STRONG&gt;: '&lt;SPAN style="color: #58595b; background-color: #ffffff;"&gt;Items are created or enter this folder,&amp;nbsp;Items are updated,&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;Items are deleted or leave this folder&lt;/SPAN&gt;&lt;/SPAN&gt;', to make a long story short, this script sends an HTTP request to another component.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Synchronize folder&lt;/STRONG&gt; : No longer used&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Prevent Edit Spaces&lt;/STRONG&gt; : '&lt;SPAN style="color: #58595b; background-color: #ffffff;"&gt;Items are deleted or leave this folder,&amp;nbsp;Items are updated&lt;/SPAN&gt;' if '&lt;SPAN style="background-color: #ffffff; color: #58595b;"&gt;Type is : Folder&lt;/SPAN&gt;', the script that we are talking about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is not&amp;nbsp;about the double triggering of the rule(s) but more about the 'Prevent Edit Spaces' rule triggering on parent folder in the same transaction that the file deletion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you mean by '&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;lower-level behavior&lt;/SPAN&gt;' ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your answer !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2018 08:13:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53615#M19961</guid>
      <dc:creator>oshikaru</dc:creator>
      <dc:date>2018-04-30T08:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent rules propagation to parent folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53616#M19962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I should have been more specific. By lower-level behavior I meant a Java behavior, see&amp;nbsp;&lt;A class="link-titled" href="https://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html" title="https://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html" rel="nofollow noopener noreferrer"&gt;Implementing Custom Behaviors in Alfresco | ECMArchitect | Alfresco Developer Tutorials&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2018 21:25:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/prevent-rules-propagation-to-parent-folder/m-p/53616#M19962</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2018-05-11T21:25:58Z</dc:date>
    </item>
  </channel>
</rss>

