AnsweredAssumed Answered

file directory

Question asked by steve_tongue on Feb 21, 2008
I'm just starting to use alfresco and I'm having problems with an advanced workflow I'm trying to write.
I'd like to move the file, depending on which folder the document starts it's workflow from to get the file. It looked like bpm_package.children[0].parent should give me the information but I can't seem to make it work.

                <script>    
                  if (bpm_package.children[0].parent == companyhome.childByNamePath("Dropbox 1"))
                       {
                       var ccrArchivedSpace = companyhome.childByNamePath("completed1");
                       }
                       else
                       {
                       var ccrArchivedSpace = companyhome.childByNamePath("completed2");
                  }
                   bpm_package.children[0].move(ccrArchivedSpace);
                    if (bpm_package.children.length &gt; 1)
                        for (var i = 1; i &lt; bpm_package.children.length; i++)
                      bpm_package.children.move(ccrArchivedSpace);
                </script>

Can't seem to get a match on the "Dropbox 1" folder.

Any help would be appreciated.

Outcomes