Define a script task that sends an email notification

In the example workflow, the person proposing the new term (the start user) is notified and the status of the term is set to Rejected if the voting result is negative. To accomplish this:

  1. Add a script task to the Start user lane.
  2. Provide a Name for the task, for example Notify requester.
  3. Add the following groovy code to the task:
  4. def usersIds = users.getUserIds("role(Requester)");
    if (usersIds.isEmpty()){
        loggerApi.warn("No users to send a mail to, no mail will be sent");
    } else {
        mail.sendMails(usersIds, "in-progress", null, execution);