<?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 Upload new Version calls onUpdateNode twice with bogus NodeRef in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/upload-new-version-calls-onupdatenode-twice-with-bogus-noderef/m-p/279149#M232279</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've created a behavior along with a custom aspect that implements the &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;OnUpdateNodePolicy&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; interface. The behavior itself does nothing spectacular: It creates or updates a PDF using the content transformation service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, when uploading a new version of the document that already has the aspect, the behavior is actually called twice: Once with the original document's NodeRef (that which has the aspect applied), and once with another NodeRef of a document/node that &amp;lt;em&amp;gt;does not exist&amp;lt;/em&amp;gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course I can easily check whether the file exists, i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;if (!fileFolderService.exists(srcNode)) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;… which of course solves the immediate problem, but I'm interested in the Why: Where does this bogus noderef come from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks alot in advance for any hints1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eric&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Dec 2014 10:53:52 GMT</pubDate>
    <dc:creator>technaton</dc:creator>
    <dc:date>2014-12-05T10:53:52Z</dc:date>
    <item>
      <title>Upload new Version calls onUpdateNode twice with bogus NodeRef</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/upload-new-version-calls-onupdatenode-twice-with-bogus-noderef/m-p/279149#M232279</link>
      <description>Hello everybody,I've created a behavior along with a custom aspect that implements the OnUpdateNodePolicy‍ interface. The behavior itself does nothing spectacular: It creates or updates a PDF using the content transformation service.Now, when uploading a new version of the document that already has</description>
      <pubDate>Fri, 05 Dec 2014 10:53:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/upload-new-version-calls-onupdatenode-twice-with-bogus-noderef/m-p/279149#M232279</guid>
      <dc:creator>technaton</dc:creator>
      <dc:date>2014-12-05T10:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Upload new Version calls onUpdateNode twice with bogus NodeRef</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/upload-new-version-calls-onupdatenode-twice-with-bogus-noderef/m-p/279150#M232280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;uploading a new version via Share is actually done using a temporary working copy. This working copy is probably your non-existent node because I presume your behaviour is bound to TRANSACTION_COMMIT and the working copy has already been deleted again at that point. For TRANSACTION_COMMIT behaviours you always HAVE TO include existence and other checks (e.g. does the trigger condition still apply?) because anything could have happend between the behaviour being schedule and actually being executed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 14:09:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/upload-new-version-calls-onupdatenode-twice-with-bogus-noderef/m-p/279150#M232280</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2014-12-05T14:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Upload new Version calls onUpdateNode twice with bogus NodeRef</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/upload-new-version-calls-onupdatenode-twice-with-bogus-noderef/m-p/279151#M232281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Axel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you very much for the explanation. You are right, the behavior is tied to &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;TRANSACTION_COMMIT&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eric&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 14:54:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/upload-new-version-calls-onupdatenode-twice-with-bogus-noderef/m-p/279151#M232281</guid>
      <dc:creator>technaton</dc:creator>
      <dc:date>2014-12-05T14:54:00Z</dc:date>
    </item>
  </channel>
</rss>

