AnsweredAssumed Answered

Copying/Moving of documents in workflow package not working

Question asked by dennish on Feb 16, 2007
Latest reply on Feb 27, 2007 by seshu
Hi,

Sorry to bother you with a problem that, from what I've read in other threads in this forum, seems to be easy to solve. Unfortunately, all the code snippets won't work for me. All I am trying to do is, in an extended version of the Review & Approve workflow, to copy the documents attached to the workflow to a backup folder when the request is rejected.

My code:

<transition name="reject" to="rejected">
        <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
              var myRoot=bpm_context.parent; // a workaround for the missing company_home root object
              var myUserhome=initiator.properties['cm:homeFolder'];
              var archiveFolder = myRoot.childByNamePath("Arbeitsbereich/Personal/Personalanforderungen/Abgelehnt");
                  for (var i = 0; i &lt; bpm_package.children.length; i++) {
                     bpm_package.children[i].copy(archiveFolder);
                  }
           </script>
         </action>
        </transition>

It won't work with the admin user as initiator and assignee of the tasks as well, so I guess it's not a problem with permissions. I've tried different folders as well, e.g. user's home directory. I am not even getting an error message, it is just not copying (or moving, as I've replaced the copy statement with move) the file which is a simple word doc.

Maybe I'm just too stupid… Hope somebody can help!

Thanks, Dennis

Outcomes