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


Java DelegateTask.setAssignee方法代码示例

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


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

示例1: onCreate

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
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());
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:21,代码来源:HumanTaskEventListener.java

示例2: onCreate

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@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());
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:22,代码来源:HumanTaskTaskListener.java

示例3: handleDelegateTaskProperty

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
/**
* {@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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ActivitiOwnerPropertyHandler.java

示例4: 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);
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:36,代码来源:TaskConfTaskListener.java

示例5: onCreate

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@Override
public void onCreate(DelegateTask delegateTask) throws Exception {
    HumanTaskDTO humanTaskDto = humanTaskConnector
            .findHumanTaskByTaskId(delegateTask.getId());
    delegateTask.setOwner(humanTaskDto.getOwner());
    delegateTask.setAssignee(humanTaskDto.getAssignee());
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:8,代码来源:HumanTaskSyncTaskListener.java

示例6: processSuperior

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
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);
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:12,代码来源:AssigneeAliasTaskListener.java

示例7: processPosition

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
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));
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:15,代码来源:AssigneeAliasTaskListener.java

示例8: notify

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@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);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:16,代码来源:AssigneeOverwriteFromVariable.java

示例9: notify

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@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");
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:8,代码来源:CreateTaskListener.java

示例10: notify

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@Override
public void notify(DelegateTask delegateTask) {
    String originAssginee = delegateTask.getAssignee();
    String newUser = userMap.get(originAssginee);
    if (StringUtils.isNotBlank(newUser)) {
        delegateTask.setAssignee(newUser);
        EngineServices engineServices = delegateTask.getExecution().getEngineServices();
        TaskService taskService = engineServices.getTaskService();
        String message = getClass().getName() + "-> 任务[" + delegateTask.getName() + "]的办理人[" + originAssginee + "]自动转办给了用户[" + newUser + "]";
        taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "delegate", message);
    } else {
        System.out.println("任务[" + delegateTask.getName() + "]没有预设的代办人");
    }
}
 
开发者ID:barudisshu,项目名称:activiti-in-action-codes,代码行数:15,代码来源:TaskAutoRedirectListener.java

示例11: onCreate

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@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);
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:46,代码来源:ConfUserTaskListener.java

示例12: 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);
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:56,代码来源:HumanTaskUserTaskListener.java

示例13: notify

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
public void notify(DelegateTask delegateTask) {
  delegateTask.setAssignee("kermit");
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:AssigneeAssignment.java


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