<?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 Re: Behaviours not triggering consistently in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251528#M204658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks very much for the quick and detailed replies, Andy.&amp;nbsp; It's very much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll grab that source and see if I should work with that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you enlighten me what package/classes might be performing the tasks as they &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;are then taken out of a set and executed in random order&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;?&amp;nbsp; I'm very curious to understand what "services" and whatnot are responsible for determining actions and callbacks that need to be executed and how they thread them and in what order.&amp;nbsp; Hopefully there's some reference already, or if you know of a starting-point class-name I can work my way through, that would be great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-AJ&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Nov 2012 01:22:19 GMT</pubDate>
    <dc:creator>aweber1nj</dc:creator>
    <dc:date>2012-11-21T01:22:19Z</dc:date>
    <item>
      <title>Behaviours not triggering consistently</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251524#M204654</link>
      <description>Not entirely sure what to expect here.&amp;nbsp; Especially given that there was a presentation "promoting" the use of behaviours at DevCon, I would expect them to be pretty stable.What I am seeing is that the "onRemoveAspect" for sys:incomplete is not consistently triggering my class.&amp;nbsp; Sometimes it does.&amp;nbsp; S</description>
      <pubDate>Tue, 20 Nov 2012 19:24:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251524#M204654</guid>
      <dc:creator>aweber1nj</dc:creator>
      <dc:date>2012-11-20T19:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Behaviours not triggering consistently</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251525#M204655</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 suggest you also turn on logging for &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.alfresco.repo.node.integrity.IncompleteNodeTagger&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The IncompleteNodeTagger builds a list of stuff to consider via the behaviour binding and does all its work on the beforeCommit as it is a TransactionListener - but it should still fire the behaviour related to the aspect removal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide a bit more detail about what you are doing? How the behaviour is bound, if you bind any transaction listener, how you deal with transactions etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 20:46:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251525#M204655</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2012-11-20T20:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Behaviours not triggering consistently</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251526#M204656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the quick reply.&amp;nbsp; I'll try to add some more details, but feel free to ask-away…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The behaviour class is java, with 3 methods bound to our custom document type on init with policyComponent.bindClassBehaviour:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;onCreateNode&lt;BR /&gt;onMoveNode&lt;BR /&gt;onUpdateProperties&lt;/UL&gt;&lt;SPAN&gt;The same class is bound using the same method (I think this is correct since there is no explicit "bindAspectBehaviour" that I can find) to sys:incomplete as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;onRemoveAspect = new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.TRANSACTION_COMMIT);&lt;BR /&gt;policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onRemoveAspect"),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentModel.ASPECT_INCOMPLETE, this.onRemoveAspect);&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;The init and some portions of the code are modeled from Jeff's "Behavior Article v2".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We need to mandate some properties for imported document-nodes in certain paths of the repository.&amp;nbsp; The properties are setup as mandatory=true, enforced=false.&amp;nbsp; We detect the import and pop-up the "doclib-simple-metadata" properties form for each.&amp;nbsp; This happens after the Folder Rule has already "specialised type" to our document type.&amp;nbsp; We also have some automated rendition services and optional OCR processing, so we have built a custom Action to call (run async) that sends the document for its Thumbnail and either an automatic PDF rendition or, in the case of images/PDF-Images, for OCR.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The execution of the rendering Action should optimally be started "ASAP" once content is saved for the node, but in order to workaround bug (sorry, &lt;/SPAN&gt;&lt;EM&gt;issue&lt;/EM&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A href="https://issues.alfresco.com/jira/browse/ALF-9688" rel="nofollow noopener noreferrer"&gt;https://issues.alfresco.com/jira/browse/ALF-9688&lt;/A&gt;&lt;SPAN&gt;, we added code to the behaviour class to detect when the properties are done being set.&amp;nbsp; We determined that one of the most appropriate manners to detect this is when the node is no longer "incomplete", because the user has added the necessary properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I was describing in my OP is a theory that the threading model of the behaviour classes in general is insufficient to allow this, because the behaviour is (sometimes – and the inconsistency drives me crazy) already executing the onUpdateProperties when the onRemoveAspect would also be called.&amp;nbsp; (Again, &lt;/SPAN&gt;&lt;EM&gt;theory/conjecture&lt;/EM&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't even have the automated pop-up installed in one env (removing it from the variables), and importing an object it gets correctly "specalised" as per rule, and if I look at my behaviour log it correctly notes that it is incomplete (most times – I have seen cases where the aspect is apparently applied "later", again lack of execution-order-consistency is killing me).&amp;nbsp; Checking node browser confirms the aspect is applied.&amp;nbsp; Then I use Share to edit the properties, and upon saving them, the behaviour's onUpdateProperties is successfully called, but not the onRemoveAspect.&amp;nbsp; Navigating to the node browser confirms that the incomplete-aspect is gone from the node, but reviewing the log (second…third time…) shows no call made to the behaviour for the removal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to think of another reason it wouldn't be called, but even at that, I would expect some kind of error or warning to be logged if it couldn't, and I don't find anything in alfresco.log or catalina.out…so I'm back to wondering if it's being detected and called at all?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully that tells the whole story.&amp;nbsp; I appreciate any insight, tips, and direction provided.&amp;nbsp; We are developing and testing against 4.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-AJ&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 21:46:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251526#M204656</guid>
      <dc:creator>aweber1nj</dc:creator>
      <dc:date>2012-11-20T21:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Behaviours not triggering consistently</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251527#M204657</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;The incomplete tagging and your behaviour are both bound into the end of transaction from what I can see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;These are then taken out of a set and executed in random order - once executed they may see notifications but never get the beforeCommit call …&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So sometimes the incomplete tagging comes first, sometimes second is my guess.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the aspect is added in the beforeCommit - your behaviour beforeCommit may have been done and then unregistered the listener =&amp;gt; It never saw the aspect added next. The debug will show this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to change IncompleteNodeTagger to do what you want in one step - fix it up and wire up the changed version in place of what we ship.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 23:04:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251527#M204657</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2012-11-20T23:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Behaviours not triggering consistently</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251528#M204658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks very much for the quick and detailed replies, Andy.&amp;nbsp; It's very much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll grab that source and see if I should work with that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you enlighten me what package/classes might be performing the tasks as they &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;are then taken out of a set and executed in random order&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;?&amp;nbsp; I'm very curious to understand what "services" and whatnot are responsible for determining actions and callbacks that need to be executed and how they thread them and in what order.&amp;nbsp; Hopefully there's some reference already, or if you know of a starting-point class-name I can work my way through, that would be great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-AJ&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 01:22:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behaviours-not-triggering-consistently/m-p/251528#M204658</guid>
      <dc:creator>aweber1nj</dc:creator>
      <dc:date>2012-11-21T01:22:19Z</dc:date>
    </item>
  </channel>
</rss>

