AnsweredAssumed Answered

<runas> trouble

Question asked by ph73nt on Feb 25, 2011
Latest reply on Oct 21, 2011 by rahul.mackdani
Dear listers

I have defined a workflow that moves documents after an approval cycle. My problem is that even with <runas>admin</admin> defined in my workflows, only the document creator (or owner if defined) can move a document. Here's a workflow snippet:


   <node name="publish">
      <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <runas>admin</runas>
            <script>
                  var i = bpm_package.children.length;
               var pathActive = companyhome.childByNamePath("Active");
               for (var i = 0; i &lt; bpm_package.children.length; i++){
                  bpm_package.children[i].move(pathActive);            
               }               
            </script>
         </action>
      </event>
      <transition to="end" name="End"></transition>
   </node>
I'd be happy to use <runas>creator</runas> but I get a transition error when I put anything other than admin as the runas target. I've tried:
- manually inserting my username
- putting in a swimlane name (eg initiator or manually defined "creator")
- bpm_package.children[0].properties.creator
- #{people.getPerson(bpm_package.children[0].properties.creator)}

All of which throw the same complaint about failing to signal the transition. Would someone be able to offer a solution to my problem?

Thanks in advance, Neil

Outcomes