AnsweredAssumed Answered

Getting Document Associated with a Task

Question asked by ebell on Jun 3, 2008
Latest reply on Jun 3, 2008 by ebell
So, I have a workflow, and within the workflow, there are task-nodes.  Now, I'm only ever running the workflow on a single document at any given time. 
However, I know that multiple documents can be tasked together. 
What I'm looking to do is to modify the aspects of the document during the task.
I can send emails, but I can't seem to change the aspects. 
I know that document doesn't work, but I don't know what to use instead.  Is bpm_package the right designator?  What should I be using? 

<task-node name="Review">
      <task name="blwf:corporateReview" swimlane="corporate" />
      <transition  name="approve" to="Approved">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                   bpm_package.removeAspect("bl:approvable");
                   bpm_package.addAspect("bl:approvable");
                   bpm_package.properties["bl:approved"] = true;
                   bpm_package.save;
               </script>
            </action>
      </transition>
      <transition name="reject" to="UpdateandResubmit" >
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                       var mail = actions.create("mail");
                       mail.parameters.to = initiator.properties.email;
                       mail.parameters.subject = "Document Rejected";
                       mail.parameters.from = "Corporate";
                       mail.parameters.text = "A document has been rejected. For more information refer to the comment part.";
                       mail.execute(bpm_package);
                 </script>
            </action>
       </transition>
   </task-node>

Outcomes