<?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 Finding a newly created node in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/finding-a-newly-created-node/m-p/257718#M210848</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;First of all, I'm very new to Alfresco and my java skills are fairly (very) rusty. Anyway; my goal is to create an advanced work-flow that handles a specific process were the users are supposed to use a set of document templates through different stages of the process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I've done so far is to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Created a folder with a rule that, whenever a folder is being created, copies the documents of interest into the newly created folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Created a test work-flow that creates a folder in the folder mentioned above (and thus triggering the other script, importing my templates)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Now I wish to add these templates as packages to the workflow, but I don't have the noderef. Below is what I've tried, but xpath expressions were apparently deactivated on our Alfresco version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;//Creating a new folder (using comment as the new folder name)&lt;BR /&gt;var nodeParent = search.findNode("workspace://SpacesStore/d23c600f-95b1-4edf-adac-3a71ded0f66b");&lt;BR /&gt;nodeParent.createFolder(bpm_comment);&lt;BR /&gt;&lt;BR /&gt;//Need to get the noderefs….&lt;BR /&gt;var childrens = nodeParent.childrens(bpm_comment+"/innkjøpsmaler");&lt;BR /&gt;&lt;BR /&gt;//Add nodes to the workflow&lt;BR /&gt;for (var i = 0; i&amp;lt;childrens.length; i++) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;bpm_package.addNode(childrens[i].nodeRef);&lt;BR /&gt;}&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried to find examples that uses the lucene engine(?) instead, but without luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Help will be much appreciated!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2012 14:46:50 GMT</pubDate>
    <dc:creator>joakims</dc:creator>
    <dc:date>2012-12-11T14:46:50Z</dc:date>
    <item>
      <title>Finding a newly created node</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/finding-a-newly-created-node/m-p/257718#M210848</link>
      <description>Hi,First of all, I'm very new to Alfresco and my java skills are fairly (very) rusty. Anyway; my goal is to create an advanced work-flow that handles a specific process were the users are supposed to use a set of document templates through different stages of the process.What I've done so far is to:</description>
      <pubDate>Tue, 11 Dec 2012 14:46:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/finding-a-newly-created-node/m-p/257718#M210848</guid>
      <dc:creator>joakims</dc:creator>
      <dc:date>2012-12-11T14:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a newly created node</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/finding-a-newly-created-node/m-p/257719#M210849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Probably not the pretties solution, but this did the trick:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var nodeParent = search.findNode("workspace://SpacesStore/d23c600f-95b1-4edf-adac-3a71ded0f66b");&lt;BR /&gt;nodeParent.createFolder(bpm_comment);&lt;BR /&gt;&lt;BR /&gt;var newNode = nodeParent.childByNamePath(bpm_comment);&lt;BR /&gt;&lt;BR /&gt;var spaceTemp = search.findNode("workspace://SpacesStore/4f35ff61-f263-4926-a0cc-a8dcf7616525");&lt;BR /&gt;spaceTemp.copy(newNode,true);&lt;BR /&gt;&lt;BR /&gt;var folderNodeMaler = newNode.childByNamePath("Innkjopsmaler");&lt;BR /&gt;var firstChildArray = folderNodeMaler.childFileFolders(true, false);&lt;BR /&gt;&lt;BR /&gt;for (var i = 0; i&amp;lt;firstChildArray.length; i++) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;bpm_package.addNode(firstChildArray[i]);&lt;BR /&gt;}&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 11:35:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/finding-a-newly-created-node/m-p/257719#M210849</guid>
      <dc:creator>joakims</dc:creator>
      <dc:date>2012-12-12T11:35:56Z</dc:date>
    </item>
  </channel>
</rss>

