cancel
Showing results for 
Search instead for 
Did you mean: 

Specify candidate group for my serviceTask

vincent_roye
Champ in-the-making
Champ in-the-making
Hi,

I am customizing a document review workflow and I would like that this serviceTask :


<serviceTask id="reviewNagEmail" name="Nag Email" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate" activiti:async="true" activiti:exclusive="false">
      <extensionElements>
        <activiti:field name="script">
              <activiti:string>              
                var mail = actions.create("mail");
               mail.parameters.to = "fff@fff.no";
               mail.parameters.subject = "reminder";
               mail.parameters.from = "fff@fff.no";
               mail.parameters.text = "It's the day";
               mail.execute(bpm_package);
            </activiti:string>
         </activiti:field>
        </extensionElements>
      </serviceTask>


sends a mail only to people who haven't reviewed the document yet. What's the best way to make it ?

Thank you very much,

Best Regards,

Vincent
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

all your review tasks would need to update a process variable where you collect all the users that have reviewed the document. In the service task you could then calculate the delta of users that have not completed (or have not started) their review task and then set the "to_many" parameter of the mail action instead of just the "to" parameter. Note that the "to" and "to_many" parameters can also be just the user name(s) of the recipients, which Alfresco then automatically resolves to the corresponding email from the person object.

Regards
Axel