cancel
Showing results for 
Search instead for 
Did you mean: 

move the file from folder to another folder

alessioa_
Champ in-the-making
Champ in-the-making
Hi to all the folks,
sorry, i know in these days i will post often but i have few time to complete the work i begin and ask on the forum is faster for solving some problems …
I have a jbpm workflow very similar the adhoc process embedded into alfresco, the difference is that when adhoc task completed i need the file on which the advanced workflow running is moved from its folder to another folder (for example from pending to completed).
In the process definition i put this code:
<transition name="" to="completed">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
                 document.move(userhome);
           </script>
         </action>
      </transition>

But receive this error
Failed to signal transition '' from workflow task 'jbpm$13'

In the stack trace i have:
[….]
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "document" is not defined
[…]

So how can refer the document on which the advanced workflow run from the processdefinition ?

Thank you very much
Best regards
Alessio A.
1 REPLY 1

davidc
Star Contributor
Star Contributor
We are all under time pressures.

A look at http://wiki.alfresco.com/wiki/WorkflowAdministration will reveal that a collection of documents are routed through the workflow.

The variable name you're after is bpm_package.

You can use it like so:

bpm_package.children[0].move(userhome);‍‍

or:

for (var i=0; ……)  bpm_package.children[i]….‍‍

Your next problem will be userhome is not specified.  Refer to the url above.