AnsweredAssumed Answered

Move a node in a schedule task.

Question asked by damunoz on Oct 12, 2010
Latest reply on Oct 12, 2010 by damunoz
Hello,

I am new to alfresco, and I have been trying to implement a schedule task that would move contract (nodes of type contracts) from a node called Active to a node called Archived.

The idea es that I can have many ClientX/Contract nodes, and inside each Contract node I can have Active/Archived nodes…  So for example, if in ClientA/Contracts/Active I have a expired contract, i have to move it to ClientA/Contracts/Archived.  The same for ClientB, ClientC, etc…

I have been successful at creating the search query that finds all the nodes that need to move, but I am having difficulties creating the destination-folder code.  This is what I have:

<entry>
                    <key>
                        <value>destination-folder</value>
                    </key>
                    <value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/../Archived/"' )}</value>
                </entry>

Someone suggested me to use the following:

<entry>
                    <key>
                        <value>destination-folder</value>
                    </key>
                    <value>${node.childrenByXPath("../Archived/")}</value>
                </entry>

But that is returning an error message sayin that expected something else, so I am guessing that is not the correct approach. (Also, I haven't seen this approach in other posts).

Any help will be greatly appreciated.

Outcomes