当前位置: 首页>>代码示例>>Java>>正文


Java DelegateTask.getCandidates方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.delegate.DelegateTask.getCandidates方法的典型用法代码示例。如果您正苦于以下问题:Java DelegateTask.getCandidates方法的具体用法?Java DelegateTask.getCandidates怎么用?Java DelegateTask.getCandidates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.delegate.DelegateTask的用法示例。


在下文中一共展示了DelegateTask.getCandidates方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notifyPool

import org.camunda.bpm.engine.delegate.DelegateTask; //导入方法依赖的package包/类
/**
 * Notifies about unassigned (pooled) task.
 *
 * @param task task no notify about
 */
public void notifyPool(DelegateTask task) {
    Set<IdentityLink> links = task.getCandidates();

    links.stream()
            .filter(link -> link.getUserId() != null)
            .map(IdentityLink::getUserId)
            .forEach(username -> {
                UserDetails user = userDetailsService.loadUserById(username);
                notNull(user, () -> new MissingObject(UserDetails.class, username));

                if (hasTaskNotifyEnabled(task)) {
                    mailCenter.sendPoolAssignment(user.getEmail(), task.getExecution().getBusinessKey(),
                            task.getId(), task.getName(), task.getTaskDefinitionKey(),
                            task.getCreateTime().toInstant(),
                            task.getDueDate() != null ? task.getDueDate().toInstant() : null);
                }
            });
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:24,代码来源:NotificationCenter.java

示例2: notifyPoolDueDate

import org.camunda.bpm.engine.delegate.DelegateTask; //导入方法依赖的package包/类
/**
 * Notifies about unassigned (pooled) task due date imminent.
 *
 * @param task task no notify about
 */
public void notifyPoolDueDate(DelegateTask task) {
    Set<IdentityLink> links = task.getCandidates();

    links.stream()
            .filter(link -> link.getUserId() != null)
            .map(IdentityLink::getUserId)
            .forEach(username -> {
                UserDetails user = userDetailsService.loadUserById(username);
                notNull(user, () -> new MissingObject(UserDetails.class, username));

                if (hasTaskNotifyEnabled(task)) {
                    mailCenter.sendPoolAssignment(user.getEmail(), task.getExecution().getBusinessKey(),
                            task.getId(), task.getName(), task.getTaskDefinitionKey(),
                            task.getCreateTime().toInstant(),
                            task.getDueDate() != null ? task.getDueDate().toInstant() : null);
                }
            });
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:24,代码来源:NotificationCenter.java

示例3: notifyAssign

import org.camunda.bpm.engine.delegate.DelegateTask; //导入方法依赖的package包/类
/**
 * Notifies about assigned task.
 *
 * @param task task no notify about
 */
public void notifyAssign(DelegateTask task) {
    String assignee = task.getAssignee();
    notNull(assignee, () -> new MissingAttribute(task, "assignee"));

    UserDetails user = userDetailsService.loadUserById(assignee);
    notNull(user, () -> new MissingObject(UserDetails.class, assignee));

    if (hasTaskNotifyEnabled(task)) {
        mailCenter.sendAssignment(user.getEmail(), task.getExecution().getBusinessKey(),
                task.getId(), task.getName(), task.getTaskDefinitionKey(),
                task.getCreateTime().toInstant(),
                task.getDueDate() != null ? task.getDueDate().toInstant() : null);
    }

    // send pool assigned mail to other candidates
    Set<IdentityLink> links = task.getCandidates();
    links.stream()
            .filter(link -> link.getUserId() != null)
            .map(IdentityLink::getUserId)
            .filter(username -> !assignee.equals(username))
            .forEach(username -> {
                UserDetails otherUser = userDetailsService.loadUserById(username);
                notNull(otherUser, () -> new MissingObject(UserDetails.class, username));

                if (hasTaskNotifyEnabled(task)) {
                    mailCenter.sendPoolAssignmentOther(otherUser.getEmail(), task.getExecution().getBusinessKey(),
                            task.getId(), task.getName(), task.getTaskDefinitionKey(),
                            task.getCreateTime().toInstant(),
                            task.getDueDate() != null ? task.getDueDate().toInstant() : null,
                            user.getFullName());
                }
            });
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:39,代码来源:NotificationCenter.java

示例4: notify

import org.camunda.bpm.engine.delegate.DelegateTask; //导入方法依赖的package包/类
public void notify(DelegateTask delegateTask) {
  Set<IdentityLink> candidates = delegateTask.getCandidates();
  Set<String> candidateUsers = new HashSet<String>();
  Set<String> candidateGroups = new HashSet<String>();
  for (IdentityLink candidate : candidates) {
    if (candidate.getUserId() != null) {
      candidateUsers.add(candidate.getUserId());
    } else if (candidate.getGroupId() != null) {
      candidateGroups.add(candidate.getGroupId());
    }
  }
  delegateTask.setVariable(VARNAME_CANDIDATE_USERS, candidateUsers);
  delegateTask.setVariable(VARNAME_CANDIDATE_GROUPS, candidateGroups);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:DelegateTaskTestTaskListener.java


注:本文中的org.camunda.bpm.engine.delegate.DelegateTask.getCandidates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。