AnsweredAssumed Answered

Finding a newly created node

Question asked by joakims on Dec 11, 2012
Latest reply on Dec 12, 2012 by joakims
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:
1. Created a folder with a rule that, whenever a folder is being created, copies the documents of interest into the newly created folder.
2. Created a test work-flow that creates a folder in the folder mentioned above (and thus triggering the other script, importing my templates)

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.


//Creating a new folder (using comment as the new folder name)
var nodeParent = search.findNode("workspace://SpacesStore/d23c600f-95b1-4edf-adac-3a71ded0f66b");
nodeParent.createFolder(bpm_comment);

//Need to get the noderefs….
var childrens = nodeParent.childrens(bpm_comment+"/innkjøpsmaler");

//Add nodes to the workflow
for (var i = 0; i<childrens.length; i++) {
   bpm_package.addNode(childrens[i].nodeRef);
}


I've tried to find examples that uses the lucene engine(?) instead, but without luck.
Help will be much appreciated!

Outcomes