<?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 Committing successful individual operation before Rollback in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274853#M227983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to transform all pdf files in a folder&amp;nbsp; to plain text; extract some meta-data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from each one of the plain text files and as it gets extracted, fill up Alfresco meta data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fields for that pdf file with those extracted values from text file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if even in a single file there is a transformation error , the whole transaction&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is rolled back.&amp;nbsp; Even log file is not saved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, the following is a simple code to transform all pdf files&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to plain text files in a folder. But if there is an error in transformation, not a single pdf file gets converted&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to text file. Even log file is not saved. If the error causing file is deleted, all rest pdf files will get&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;transformed to plain text. (alfresco version is: 3.4.d)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is very frustrating for I cannot carry out operation even on a single file. Please advise what&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is the way out so that except the error causing file all other files get processed/transformed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;// Location of log file report&lt;BR /&gt;var dest = companyhome.childByNamePath("Sites/myoffice/documentLibrary/AURC Space/DEO/Reports") ;&lt;BR /&gt;// Create new log file and add heading&lt;BR /&gt;logFile =&amp;nbsp; dest.createFile("log.txt") ;&lt;BR /&gt;logFile.content = "Record of which files failed transformation" + "\r\n" ;&lt;BR /&gt;&lt;BR /&gt;// Start iterating over all files in Drafts folder and transform each, one by one&lt;BR /&gt;var draftfolder =&amp;nbsp; companyhome.childByNamePath("Sites/myoffice/documentLibrary/AURC Space/DEO/Drafts") ;&lt;BR /&gt;var childfiles = draftfolder.children ;&lt;BR /&gt;var filenumb = childfiles.length ; &lt;BR /&gt;var count = 0 ;&lt;BR /&gt;// Go through each file, one by one&lt;BR /&gt;for ( i = 0 ; i &amp;lt; filenumb ; i++ )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var docu = childfiles[i] ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var newtxtNode ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&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;newtxtNode = docu.transformDocument("text/plain") ;&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; newtxtNode.save() ;&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;catch (e)&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;logFile.content += ++count + " Error in transformation: " + docu.name &amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;} // end of for loop&lt;BR /&gt;logFile.save() ;&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;/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;Will be grateful for reply.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 May 2012 10:16:18 GMT</pubDate>
    <dc:creator>ashokharnal</dc:creator>
    <dc:date>2012-05-20T10:16:18Z</dc:date>
    <item>
      <title>Committing successful individual operation before Rollback</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274853#M227983</link>
      <description>I am trying to transform all pdf files in a folder&amp;nbsp; to plain text; extract some meta-datafrom each one of the plain text files and as it gets extracted, fill up Alfresco meta datafields for that pdf file with those extracted values from text file.However, if even in a single file there is a transfor</description>
      <pubDate>Sun, 20 May 2012 10:16:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274853#M227983</guid>
      <dc:creator>ashokharnal</dc:creator>
      <dc:date>2012-05-20T10:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Committing successful individual operation before Rollback</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274854#M227984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd write the action in Java and have each transformation in a separate transaction.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AFAIK you can't control transactions through the script API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or another option could be to queue actions to do the transformations asynchronously.&amp;nbsp;&amp;nbsp; That's possibley a much better approach.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 May 2012 20:02:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274854#M227984</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2012-05-20T20:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Committing successful individual operation before Rollback</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274855#M227985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear mrogers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kindly consider the following part of your reply:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Or another option could be to queue actions to do the transformations asynchronously. That's possibly a much better approach.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Please amplify it. How do we queue actions? Does it mean, I write a javascript for operation on one file and then design an inbound rule, that as and when a pdf file enters the particular folder, the java script will run in the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;background to work on that pdf file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am uploading around 300GB of data residing in about 1600 files through smbclient. The uploading is being&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;done in batches and will take around a week's time. This operation is being carried out in various offices (for each office around 300GB). Uploading data through smb is also time consuming process. Meanwhile this background process (on each pdf file) may start slowing down uploading. Or is there some way to control it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ashok Kumar Harnal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 00:29:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274855#M227985</guid>
      <dc:creator>ashokharnal</dc:creator>
      <dc:date>2012-05-21T00:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Committing successful individual operation before Rollback</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274856#M227986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear mrogers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am experimenting with scheduling action with 'transactionmode' set as ISOLATED_TRANSACTIONS &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and building a query template that will filter all nodes (pdf files) from Drafts folder. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to change the query and scheduler definitions without restarting Alfresco? In that case where&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;should I place these definitions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will be grateful for help. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ashok Kumar Harnal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 02:46:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274856#M227986</guid>
      <dc:creator>ashokharnal</dc:creator>
      <dc:date>2012-05-21T02:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Committing successful individual operation before Rollback</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274857#M227987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well I was finally successful. Instead of building a loop in javascript that iterates over all files,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and works on them. I coded javascript that worked only on one document. To make this code to work&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on all desired nodes, a query template was provided in Scheduled action xml file and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the transaction mode was set to ISOLATED_TRANSACTIONS. Even if the code failed to work over&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;any pdf file, action would continue and would then pass on to the next pdf file to work upon it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2012 01:39:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/committing-successful-individual-operation-before-rollback/m-p/274857#M227987</guid>
      <dc:creator>ashokharnal</dc:creator>
      <dc:date>2012-05-28T01:39:39Z</dc:date>
    </item>
  </channel>
</rss>

