AnsweredAssumed Answered

Copy Documents within a review Workflow

Question asked by jouschman on Jul 15, 2010
Latest reply on Jul 15, 2010 by zladuric
Hi all,

I' m completly new to Alfresco. I have a problem with javascript, which copies the documents within the review workflow to homespaces of specific users.
The target persons are in an association of the custom content model which will be set by content rules. The model is valid and can be used.

I've tried to create a JavaScript to implement this copy mechnism to the specific home dirs. But it did not work.
Here is the code I've tried (with a static username):

copier.js

var personNodeRef = personService.getPerson(admin);
NodeRef homespaceNodeRef = (NodeRef) nodeService.getProperty(personNodeRef, ContentModel.PROP_HOMEFOLDER);
NodeRef localeNoderef = document.getnodeRef;
filefolderservice.copy(localeNoderef,homespaceNoderef, "test");
copy.save();

Additionally I would like to implement 2 more things:
* The target person is saved within a association called my:person, which the reviewer has to set - How can I read (through the array) every usernames.
* I would like to add theses script to the out-of-the-box review Workflow. I think the right transistion would be the last one:

review_processdefinition.xml
 
  <task name="wf:approvedTask" swimlane="initiator" />
                <transition name="" to="end">
                         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                                <script>
                                      // it should be here?
                                </script>
                         </action>
                </transition>
        </task-node>

———————————-
Facts to the environment:
Version Alfresco: Alfresco 3.3
OS: Ubuntu 10.04 Lucid Lynx
DB: MySQL
———————————-

Can you help me?

Outcomes