<?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: Transaction failed on custom operation ? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317443#M4444</link>
    <description>&lt;P&gt;Finally worked with a work-around ie:&lt;/P&gt;
&lt;P&gt;1/ Create &lt;A href="https://github.com/modulo-z/nuxeo/blob/master/z-modulo-automation/src/main/java/com/z/modulo/nuxeo/automation/GetParents.java"&gt;this&lt;/A&gt; custom operation to push parents into context as a list&lt;/P&gt;
&lt;P&gt;2/ Use a "Run for each" operation to evaluate if the child has to be created or not as a section, create the referring section if required.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Feb 2013 10:49:44 GMT</pubDate>
    <dc:creator>Antoine_Cordier</dc:creator>
    <dc:date>2013-02-25T10:49:44Z</dc:date>
    <item>
      <title>Transaction failed on custom operation ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317439#M4440</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm trying to create a custom operation for the first time with nuxeo IDE.&lt;/P&gt;
&lt;P&gt;This operation aims to duplicate current workspace hierarchy as a section hierarchy in the parent domain.&lt;/P&gt;
&lt;P&gt;With provided studio operations, i managed easily to create a matching section as a workspace is created in the domain (Each of my domains have a sections root and a workspace root)...&lt;/P&gt;
&lt;P&gt;But here i get a "transaction failed" error in the UI though what I get in the logs seems to assert my document hierarchy is somehow created.&lt;/P&gt;
&lt;P&gt;This is how i try to create my sections hierarchy :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;for(int i = nodes.size()-1; i &amp;gt;= 0; i --){
			nodeName = nodes.get(i).get(0);
			try {
				logger.warn("--"+nodes.get(i).get(0)+"--"+nodes.get(i).get(1));
				sectionRoot = session.getChild(ref, nodeName.trim());	
			} catch (ClientException e) {
				sectionRoot = session.createDocumentModel(sectionRoot.getPathAsString(), nodeName.trim(), "Section");
				logger.warn("--Section root Path : "+sectionRoot.getPathAsString()+"--");
				sectionRoot.setPropertyValue("dc:title", nodeName);
				sectionRoot = session.createDocument(sectionRoot);
			}
			ref = sectionRoot.getRef();
		}

		session.save();
		return sectionRoot;
	}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And here is what i get in the logs :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;2013-02-18 16:40:49,235 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --MirrorSectionHierarchy --under test-- 
2013-02-18 16:40:49,237 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --First parent bound is test-- 
2013-02-18 16:40:49,239 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --workspaceName has value : Zone de fouilles-- 
2013-02-18 16:40:49,244 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --sectionRoot has value : Zone de publications
2013-02-18 16:40:49,245 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --Commandes--Folder
2013-02-18 16:40:49,247 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --Section root Path : /UniversitÃ© Lille 2/SI/GED - SI/Sections/Zone de fouilles/Commandes--
2013-02-18 16:40:49,253 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --test--OrderedFolder
2013-02-18 16:40:49,254 WARN  [fr.univlille2.ecm.automation.MirrorSectionHierarchy] --Section root Path : /UniversitÃ© Lille 2/SI/GED - SI/Sections/Zone de fouilles/Commandes/test--
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can someone please help me with what is missing here ?
Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2013 17:10:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317439#M4440</guid>
      <dc:creator>Antoine_Cordier</dc:creator>
      <dc:date>2013-02-18T17:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction failed on custom operation ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317440#M4441</link>
      <description>&lt;P&gt;Even trying to handle the operation in a dedicated transaction is useless, i don't get any error message but my section tree is still not created though i can get the path i expect to draw passing a getPathAsString() on the last document i'm trying to create&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2013 16:03:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317440#M4441</guid>
      <dc:creator>Antoine_Cordier</dc:creator>
      <dc:date>2013-02-19T16:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction failed on custom operation ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317441#M4442</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2013 11:10:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317441#M4442</guid>
      <dc:creator>Anahide_Tchertc</dc:creator>
      <dc:date>2013-02-20T11:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction failed on custom operation ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317442#M4443</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2013 12:05:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317442#M4443</guid>
      <dc:creator>Antoine_Cordier</dc:creator>
      <dc:date>2013-02-20T12:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction failed on custom operation ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317443#M4444</link>
      <description>&lt;P&gt;Finally worked with a work-around ie:&lt;/P&gt;
&lt;P&gt;1/ Create &lt;A href="https://github.com/modulo-z/nuxeo/blob/master/z-modulo-automation/src/main/java/com/z/modulo/nuxeo/automation/GetParents.java"&gt;this&lt;/A&gt; custom operation to push parents into context as a list&lt;/P&gt;
&lt;P&gt;2/ Use a "Run for each" operation to evaluate if the child has to be created or not as a section, create the referring section if required.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2013 10:49:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/transaction-failed-on-custom-operation/m-p/317443#M4444</guid>
      <dc:creator>Antoine_Cordier</dc:creator>
      <dc:date>2013-02-25T10:49:44Z</dc:date>
    </item>
  </channel>
</rss>

