Java Code Examples for org.activiti.engine.delegate.DelegateTask#setAssignee()
The following examples show how to use
org.activiti.engine.delegate.DelegateTask#setAssignee() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HumanTaskTaskListener.java From lemon with Apache License 2.0 | 6 votes |
@Override public void onCreate(DelegateTask delegateTask) throws Exception { HumanTaskDTO humanTaskDto = null; // 根据delegateTask创建HumanTaskDTO try { DelegateTaskHolder.setDelegateTask(delegateTask); humanTaskDto = this.createHumanTask(delegateTask); // 任务抄送 this.checkCopyHumanTask(delegateTask, humanTaskDto); } finally { DelegateTaskHolder.clear(); } if (humanTaskDto != null) { delegateTask.setAssignee(humanTaskDto.getAssignee()); delegateTask.setOwner(humanTaskDto.getOwner()); } }
Example 2
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 3
Source File: HumanTaskSyncTaskListener.java From lemon with Apache License 2.0 | 5 votes |
@Override public void onCreate(DelegateTask delegateTask) throws Exception { HumanTaskDTO humanTaskDto = humanTaskConnector .findHumanTaskByTaskId(delegateTask.getId()); delegateTask.setOwner(humanTaskDto.getOwner()); delegateTask.setAssignee(humanTaskDto.getAssignee()); }
Example 4
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 5
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 6
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 7
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 8
Source File: TaskConfTaskListener.java From lemon with Apache License 2.0 | 5 votes |
@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); } }
Example 9
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 10
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 11
Source File: UserTaskListener.java From open-cloud with MIT License | 5 votes |
/** * 指定个人任务和组任务的办理人 */ @Override public void notify(DelegateTask delegateTask) { //从数据库中查询出指定的班里人 String assignee = "张无忌"; //指定个人任务 delegateTask.setAssignee(assignee); }
Example 12
Source File: CreateTaskListener.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { System.out.println(task.getValue(delegateTask)); delegateTask.setVariable("setInTaskCreate", delegateTask.getEventName() + ", " + content.getValue(delegateTask)); System.out.println(delegateTask.getEventName() + ",任务分配给:" + delegateTask.getAssignee()); delegateTask.setAssignee("jenny"); }
Example 13
Source File: ActivitiOwnerPropertyHandler.java From alfresco-repository with GNU Lesser General Public License v3.0 | 5 votes |
/** * {@inheritDoc} */ @Override protected Object handleDelegateTaskProperty(DelegateTask task, TypeDefinition type, QName key, Serializable value) { checkType(key, value, String.class); String assignee = (String) value; String currentAssignee = task.getAssignee(); // Only set the assignee if the value has changes to prevent // triggering assignementhandlers when not needed if (currentAssignee == null || !currentAssignee.equals(assignee)) { task.setAssignee(assignee); } return DO_NOT_ADD; }
Example 14
Source File: ResourceEnterToDepartmentListener.java From MicroCommunity with Apache License 2.0 | 5 votes |
@Override public void notify(DelegateTask delegateTask) { logger.info("查询部门审核人员"); // auditUserInnerServiceSMOImpl = ApplicationContextFactory.getBean("auditUserInnerServiceSMOImpl", IAuditUserInnerServiceSMO.class); // AuditUserDto auditUserDto = new AuditUserDto(); // PurchaseApplyDto purchaseApplyDto = (PurchaseApplyDto)delegateTask.getVariable("purchaseApplyDto"); String nextAuditStaffId = delegateTask.getVariable("nextAuditStaffId").toString(); /*auditUserDto.setStoreId(purchaseApplyDto.getStoreId()); auditUserDto.setObjCode("resourceEntry"); auditUserDto.setAuditLink("809001"); List<AuditUserDto> auditUserDtos = auditUserInnerServiceSMOImpl.queryAuditUsers(auditUserDto); for (AuditUserDto tmpAuditUser : auditUserDtos) { AuditUser auditUser = BeanConvertUtil.covertBean(tmpAuditUser, AuditUser.class); logger.info("查询到用户:"+tmpAuditUser.getUserName()); delegateTask.setVariable(auditUser.getUserId(), auditUser); } logger.info("查询审核人员人数:"+auditUserDtos.size()); if (auditUserDtos == null || auditUserDtos.size() < 1) { return; }*/ delegateTask.setAssignee(nextAuditStaffId); logger.info("设置部门审核人员:"+nextAuditStaffId); }
Example 15
Source File: AssigneeAliasTaskListener.java From lemon with Apache License 2.0 | 5 votes |
public void processPosition(DelegateTask delegateTask, AssigneeRule assigneeRule, String value) { String processInstanceId = delegateTask.getProcessInstanceId(); String startUserId = Context.getCommandContext() .getHistoricProcessInstanceEntityManager() .findHistoricProcessInstance(processInstanceId) .getStartUserId(); List<String> userIds = assigneeRule.process(value, startUserId); logger.debug("userIds : {}", userIds); if (!userIds.isEmpty()) { delegateTask.setAssignee(userIds.get(0)); } }
Example 16
Source File: AssigneeOverwriteFromVariable.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") public void notify(DelegateTask delegateTask) { // get mapping table from variable DelegateExecution execution = delegateTask.getExecution(); Map<String, String> assigneeMappingTable = (Map<String, String>) execution.getVariable("assigneeMappingTable"); // get assignee from process String assigneeFromProcessDefinition = delegateTask.getAssignee(); // overwrite assignee if there is an entry in the mapping table if (assigneeMappingTable.containsKey(assigneeFromProcessDefinition)) { String assigneeFromMappingTable = assigneeMappingTable.get(assigneeFromProcessDefinition); delegateTask.setAssignee(assigneeFromMappingTable); } }
Example 17
Source File: AssigneeOverwriteFromVariable.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") public void notify(DelegateTask delegateTask) { // get mapping table from variable DelegateExecution execution = delegateTask.getExecution(); Map<String, String> assigneeMappingTable = (Map<String, String>) execution.getVariable("assigneeMappingTable"); // get assignee from process String assigneeFromProcessDefinition = delegateTask.getAssignee(); // overwrite assignee if there is an entry in the mapping table if (assigneeMappingTable.containsKey(assigneeFromProcessDefinition)) { String assigneeFromMappingTable = assigneeMappingTable.get(assigneeFromProcessDefinition); delegateTask.setAssignee(assigneeFromMappingTable); } }
Example 18
Source File: AssigneeAliasTaskListener.java From lemon with Apache License 2.0 | 5 votes |
public void processSuperior(DelegateTask delegateTask, AssigneeRule assigneeRule, String value) { String processInstanceId = delegateTask.getProcessInstanceId(); String startUserId = Context.getCommandContext() .getHistoricProcessInstanceEntityManager() .findHistoricProcessInstance(processInstanceId) .getStartUserId(); String userId = assigneeRule.process(startUserId); logger.debug("userId : {}", userId); delegateTask.setAssignee(userId); }
Example 19
Source File: AssigneeAssignment.java From activiti6-boot2 with Apache License 2.0 | 4 votes |
public void notify(DelegateTask delegateTask) { delegateTask.setAssignee("kermit"); }
Example 20
Source File: ConfUserTaskListener.java From lemon with Apache License 2.0 | 4 votes |
@Override public void onCreate(DelegateTask delegateTask) throws Exception { List<BpmConfUser> bpmConfUsers = bpmConfUserManager .find("from BpmConfUser where bpmConfNode.bpmConfBase.processDefinitionId=? and bpmConfNode.code=?", delegateTask.getProcessDefinitionId(), delegateTask .getExecution().getCurrentActivityId()); logger.debug("{}", bpmConfUsers); ExpressionManager expressionManager = Context .getProcessEngineConfiguration().getExpressionManager(); try { for (BpmConfUser bpmConfUser : bpmConfUsers) { logger.debug("status : {}, type: {}", bpmConfUser.getStatus(), bpmConfUser.getType()); logger.debug("value : {}", bpmConfUser.getValue()); String value = expressionManager .createExpression(bpmConfUser.getValue()) .getValue(delegateTask).toString(); if (bpmConfUser.getStatus() == 1) { if (bpmConfUser.getType() == 0) { delegateTask.setAssignee(value); } else if (bpmConfUser.getType() == 1) { delegateTask.addCandidateUser(value); } else if (bpmConfUser.getType() == 2) { delegateTask.addCandidateGroup(value); } } else if (bpmConfUser.getStatus() == 2) { if (bpmConfUser.getType() == 0) { if (delegateTask.getAssignee().equals(value)) { delegateTask.setAssignee(null); } } else if (bpmConfUser.getType() == 1) { delegateTask.deleteCandidateUser(value); } else if (bpmConfUser.getType() == 2) { delegateTask.deleteCandidateGroup(value); } } } } catch (Exception ex) { logger.debug(ex.getMessage(), ex); } }