AnsweredAssumed Answered

Calling workflow assignee's e-mail in Javascript

Question asked by hanoul on Jul 28, 2009
Latest reply on Oct 5, 2010 by tejaskanani292004
I have added e-mail notification to my Web Site Submission workflow (Enterprise version 3.1).
At the moment, I have the recipient's e-mail address hard coded in my script. However, I would like to have the e-mail sent to the next 'assignee' in a serial review. How can I call the next serial reviewer's (assignee) e-mail address in Javascript?

My code at present is the following, and is placed inside the 'submitserialreview' decision node inside <configRoot>/alfresco/workflow/submit-processdefinition.xml:

    <decision name="submitserialreview">
       <transition name="endreview" to="endreview" />
       <transition name="review" to="serialreview">
         <condition>#{wcmwf_approveCnt &lt; wcmwf_reviewerCnt}</condition>
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <expression> 
               var mail = actions.create("mail");
               mail.parameters.to = "recipient_email@xxxx.com";
               mail.parameters.subject = "New Alfresco workflow submission: " + wcmwf_label + " by " + person.properties.userName;
               mail.parameters.from = initiator.properties["cm:email"];
               mail.parameters.text = person.properties.firstName + " " + person.properties.lastName + " has submitted the following content for your approval";
               mail.execute(bpm_package);               
               </expression>
            </script>
         </action>
       </transition>
    </decision>

Outcomes