本文整理汇总了Java中org.activiti.engine.delegate.DelegateTask.addCandidateUsers方法的典型用法代码示例。如果您正苦于以下问题:Java DelegateTask.addCandidateUsers方法的具体用法?Java DelegateTask.addCandidateUsers怎么用?Java DelegateTask.addCandidateUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.delegate.DelegateTask
的用法示例。
在下文中一共展示了DelegateTask.addCandidateUsers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@Override
public void onCreate(DelegateTask delegateTask) throws Exception {
String businessKey = delegateTask.getExecution()
.getProcessBusinessKey();
String taskDefinitionKey = delegateTask.getTaskDefinitionKey();
ExpressionManager expressionManager = Context
.getProcessEngineConfiguration().getExpressionManager();
try {
String sql = "select ASSIGNEE from BPM_TASK_CONF where BUSINESS_KEY=? and TASK_DEFINITION_KEY=?";
String assignee = jdbcTemplate.queryForObject(sql, String.class,
businessKey, taskDefinitionKey);
if ((assignee == null) || "".equals(assignee)) {
return;
}
if ((assignee.indexOf("&&") != -1)
|| (assignee.indexOf("||") != -1)) {
logger.info("assignee : {}", assignee);
List<String> candidateUsers = new Expr().evaluate(assignee,
this);
logger.info("candidateUsers : {}", candidateUsers);
delegateTask.addCandidateUsers(candidateUsers);
} else {
String value = expressionManager.createExpression(assignee)
.getValue(delegateTask).toString();
delegateTask.setAssignee(value);
}
} catch (Exception ex) {
logger.debug(ex.getMessage(), ex);
}
}
示例2: onCreate
import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@Override
public void onCreate(DelegateTask delegateTask) throws Exception {
String processDefinitionId = delegateTask.getProcessDefinitionId();
String businessKey = delegateTask.getExecution()
.getProcessBusinessKey();
String taskDefinitionKey = delegateTask.getExecution()
.getCurrentActivityId();
ProcessTaskDefinition processTaskDefinition = internalProcessConnector
.findTaskDefinition(processDefinitionId, businessKey,
taskDefinitionKey);
ExpressionManager expressionManager = Context
.getProcessEngineConfiguration().getExpressionManager();
for (ParticipantDefinition participantDefinition : processTaskDefinition
.getParticipantDefinitions()) {
if ("user".equals(participantDefinition.getType())) {
if ("add".equals(participantDefinition.getStatus())) {
delegateTask.addCandidateUser(participantDefinition
.getValue());
} else {
delegateTask.deleteCandidateUser(participantDefinition
.getValue());
}
} else {
if ("add".equals(participantDefinition.getStatus())) {
delegateTask.addCandidateGroup(participantDefinition
.getValue());
} else {
delegateTask.deleteCandidateGroup(participantDefinition
.getValue());
}
}
}
String assignee = null;
if (processTaskDefinition.getAssignee() != null) {
assignee = expressionManager
.createExpression(processTaskDefinition.getAssignee())
.getValue(delegateTask).toString();
}
if (assignee == null) {
delegateTask.setAssignee(null);
} else if ((assignee.indexOf("&&") != -1)
|| (assignee.indexOf("||") != -1)) {
logger.debug("assignee : {}", assignee);
List<String> candidateUsers = new Expr().evaluate(assignee, this);
logger.debug("candidateUsers : {}", candidateUsers);
delegateTask.addCandidateUsers(candidateUsers);
} else {
delegateTask.setAssignee(assignee);
}
}