}
public List<User> findUsersById(String... strings) {
SortedSet<User> emails = new TreeSet<User>();
try {
ExecutionImpl execution = ((ExecutionContext)EnvironmentImpl.getCurrent().getContext("execution")).getExecution();
WorkflowDefinition def = (WorkflowDefinition) execution.getVariable("workflow");
String id = (String) execution.getVariable("nodeId");
for (String userId : strings) {
if (userId.equals("previousTaskAssignable")) {
JCRNodeWrapper node = JCRSessionFactory.getInstance().getCurrentUserSession().getNodeByUUID(id);
List<JahiaPrincipal> principals = WorkflowService.getInstance().getAssignedRole(node, def,
execution.getActivity().getIncomingTransitions().get(0).getSource().getName(), execution.getProcessInstance().getId());
iterateOverPrincipals(emails, userId, principals);
} else if (userId.equals("nextTaskAssignable")) {
JCRNodeWrapper node = JCRSessionFactory.getInstance().getCurrentUserSession().getNodeByUUID(id);
List<JahiaPrincipal> principals = WorkflowService.getInstance().getAssignedRole(node, def,
execution.getActivity().getDefaultOutgoingTransition().getDestination().getName(), execution.getProcessInstance().getId());
iterateOverPrincipals(emails, userId, principals);
} else if (userId.equals("currentWorkflowStarter")) {
String jahiaUser = (String) execution.getVariable("user");
JahiaUserManagerService service = ServicesRegistry.getInstance().getJahiaUserManagerService();
JahiaUser user = service.lookupUserByKey(jahiaUser);
addUser(emails, userId, user);
} else if (userId.equals("jahiaSettingsProperty")) {
emails.add(new UserImpl(userId, "", "", SettingsBean.getInstance().getMail_from()));