<?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 Problem moving node in an Action in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172796#M125982</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;I get a problem with moving nodes inside an Alfresco Action. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here the details of my task:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; 1. Put 2 OpenOffice/StarOffice document (.odt) in a specific folder by FTP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 2. A specific rule (Action) is launched to process the documents&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Make some checks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Create subdirectories if doesn t exist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Move to the directory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is when the action occurs, the subdirectories are created (like DIR1/DIR2/DIR3 and DIR1/DIR2/DIR4 ) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but one file is inside DIR3 but the other one stay in the root folder. &lt;/SPAN&gt;&lt;STRONG&gt;This problem does not occurs every time I test (with the same documents)&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The action is not synchronised as I said my bean scope to be "prototype" (Spring context) because I want many actions &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;processing the files in the same time. That is because the finality is to be able to process hundreds of files at a certain time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you tell me if such Alfresco action could be defined as prototype instead of singleton, and if yes, do you have an idea where I can have a look for that problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; My Alfresco version is 2.1.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Thanks for your help&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Patrick&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS: I tried to use transactions like in &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Alfresco_Content_Management_Java_API#User_Transaction" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Alfresco_Content_Management_Java_API#User_Transaction&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but it looks like an action does not support nested transactions (I commit successfully but at the end of (after?) the action Alfresco throws the exception : &lt;/SPAN&gt;&lt;STRONG&gt;UserTransaction begin/commit mismatch&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Apr 2008 12:31:14 GMT</pubDate>
    <dc:creator>ruffp</dc:creator>
    <dc:date>2008-04-09T12:31:14Z</dc:date>
    <item>
      <title>Problem moving node in an Action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172796#M125982</link>
      <description>Hello,I get a problem with moving nodes inside an Alfresco Action. Here the details of my task: 1. Put 2 OpenOffice/StarOffice document (.odt) in a specific folder by FTP 2. A specific rule (Action) is launched to process the documents&amp;nbsp;&amp;nbsp;&amp;nbsp;- Make some checks&amp;nbsp;&amp;nbsp;&amp;nbsp;- Create subdirectories if doesn t exist&amp;nbsp;</description>
      <pubDate>Wed, 09 Apr 2008 12:31:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172796#M125982</guid>
      <dc:creator>ruffp</dc:creator>
      <dc:date>2008-04-09T12:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem moving node in an Action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172797#M125983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The solution is easy. You need to be sure that the directories/spaces are COMPLETELLY created and STORED before moving the file in the directory. The solution is to force the creation of the spaces. This is done calling the save() function on the created space (where you plan to store the file). I had such problem and this solved the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 18:08:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172797#M125983</guid>
      <dc:creator>mabayona</dc:creator>
      <dc:date>2008-04-09T18:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem moving node in an Action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172798#M125984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The save() method you mention is when programming in JS language but it does not apply to my Action because mine is implemented in Java deriving the ActionExecuterAbstractBase.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For more details, I use the fileFolderService to create the directory structure like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private FileInfo createFolder(NodeRef currentFolder, String folderName) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileInfo fileInfo = getFileOrFolder(currentFolder, folderName); // check existence&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (fileInfo == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try {&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;fileInfo = this.fileFolderService.create(currentFolder, folderName, ContentModel.TYPE_FOLDER);&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;} catch (FileExistsException e) {&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;// Should never happen&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&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;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return fileInfo;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This function is called many times and the move is always called after. I don't know if it is my action's responsibility to synchronize all the thread because it is difficult (or impossible?) to control the behavior of the Alfresco services.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can already say that I refer always to transactional services (with 1st capital letter) beans.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for help&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2008 09:43:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172798#M125984</guid>
      <dc:creator>ruffp</dc:creator>
      <dc:date>2008-04-10T09:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem moving node in an Action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172799#M125985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is possible to do the same in Java. I read about it in the forums/wiki. I do no remember exactly where but the concept remains: you have to be sure that the space is created and flushed before trying to copy/move it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Look for TRANSACTION_COMMIT option in the forums / wiki and youÂ´ll find a solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also look at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.ecmarchitect.com/images/articles/alfresco-behavior/behavior-article.pdf" rel="nofollow noopener noreferrer"&gt;http://www.ecmarchitect.com/images/articles/alfresco-behavior/behavior-article.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2008 10:38:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-moving-node-in-an-action/m-p/172799#M125985</guid>
      <dc:creator>mabayona</dc:creator>
      <dc:date>2008-04-10T10:38:06Z</dc:date>
    </item>
  </channel>
</rss>

