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


Java HistoricProcessInstanceEntity.getStartUserId方法代码示例

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


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

示例1: processPosition

import org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity; //导入方法依赖的package包/类
public void processPosition(DelegateTask delegateTask, String value) {
    String processInstanceId = delegateTask.getProcessInstanceId();
    HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
            .getCommandContext().getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);
    String initiator = historicProcessInstanceEntity.getStartUserId();
    OrgConnector orgConnector = (OrgConnector) ApplicationContextHelper
            .getBean(OrgConnector.class);

    // 获得发起人的职位
    int initiatorLevel = orgConnector.getJobLevelByUserId(initiator);

    // 获得审批人的职位
    int assigneeLevel = orgConnector.getJobLevelByUserId(delegateTask
            .getAssignee());

    // 比较
    if (initiatorLevel >= assigneeLevel) {
        logger.info("skip task : {}", delegateTask.getId());
        logger.info("initiatorLevel : {}, assigneeLevel : {}",
                initiatorLevel, assigneeLevel);
        new CompleteTaskWithCommentCmd(delegateTask.getId(),
                Collections.<String, Object> emptyMap(), "高级职位自动跳过")
                .execute(Context.getCommandContext());
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:27,代码来源:SkipTaskListener.java

示例2: processExpression

import org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity; //导入方法依赖的package包/类
public void processExpression(DelegateTask delegateTask, String value) {
    UserConnector userConnector = ApplicationContextHelper
            .getBean(UserConnector.class);
    ExpressionManager expressionManager = Context
            .getProcessEngineConfiguration().getExpressionManager();
    String processInstanceId = delegateTask.getProcessInstanceId();
    HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
            .getCommandContext().getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);
    String initiator = historicProcessInstanceEntity.getStartUserId();
    MapVariableScope mapVariableScope = new MapVariableScope();
    mapVariableScope.setVariable("initiator",
            userConnector.findById(initiator));

    Object objectResult = expressionManager.createExpression(value)
            .getValue(mapVariableScope);

    if ((objectResult == null) || (!(objectResult instanceof Boolean))) {
        logger.error("{} is not Boolean, just return", objectResult);

        return;
    }

    Boolean result = (Boolean) objectResult;

    logger.info("value : {}, result : {}", value, result);

    if (result) {
        logger.info("skip task : {}", delegateTask.getId());
        new CompleteTaskWithCommentCmd(delegateTask.getId(),
                Collections.<String, Object> emptyMap(), "跳过")
                .execute(Context.getCommandContext());
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:35,代码来源:SkipTaskListener.java

示例3: processPosition

import org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity; //导入方法依赖的package包/类
public void processPosition(DelegateTask delegateTask, String value) {
    String processInstanceId = delegateTask.getProcessInstanceId();
    HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
            .getCommandContext().getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);
    String initiator = historicProcessInstanceEntity.getStartUserId();
    OrgConnector orgConnector = (OrgConnector) ApplicationContextHelper
            .getBean(OrgConnector.class);

    // 获得发起人的职位
    int initiatorLevel = orgConnector.getJobLevelByUserId(initiator);

    // 获得审批人的职位
    int assigneeLevel = orgConnector.getJobLevelByUserId(delegateTask
            .getAssignee());

    // 比较
    if (initiatorLevel >= assigneeLevel) {
        logger.info("skip task : {}", delegateTask.getId());
        logger.info("initiatorLevel : {}, assigneeLevel : {}",
                initiatorLevel, assigneeLevel);
        // new CompleteTaskWithCommentCmd(delegateTask.getId(),
        // Collections.<String, Object> emptyMap(), "高级职位自动跳过")
        // .execute(Context.getCommandContext());
        this.doSkip(delegateTask);
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:28,代码来源:SkipEventListener.java

示例4: processExpression

import org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity; //导入方法依赖的package包/类
public void processExpression(DelegateTask delegateTask, String value) {
    UserConnector userConnector = ApplicationContextHelper
            .getBean(UserConnector.class);
    ExpressionManager expressionManager = Context
            .getProcessEngineConfiguration().getExpressionManager();
    String processInstanceId = delegateTask.getProcessInstanceId();
    HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
            .getCommandContext().getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);
    String initiator = historicProcessInstanceEntity.getStartUserId();
    MapVariableScope mapVariableScope = new MapVariableScope();
    mapVariableScope.setVariable("initiator",
            userConnector.findById(initiator));

    Object objectResult = expressionManager.createExpression(value)
            .getValue(mapVariableScope);

    if ((objectResult == null) || (!(objectResult instanceof Boolean))) {
        logger.error("{} is not Boolean, just return", objectResult);

        return;
    }

    Boolean result = (Boolean) objectResult;

    logger.info("value : {}, result : {}", value, result);

    if (result) {
        logger.info("skip task : {}", delegateTask.getId());
        // new CompleteTaskWithCommentCmd(delegateTask.getId(),
        // Collections.<String, Object> emptyMap(), "跳过")
        // .execute(Context.getCommandContext());
        this.doSkip(delegateTask);
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:36,代码来源:SkipEventListener.java

示例5: execute

import org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity; //导入方法依赖的package包/类
public Void execute(CommandContext commandContext) {
    HistoricProcessInstanceEntity historicProcessInstanceEntity = commandContext
            .getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(historicProcessInstanceId);

    if (historicProcessInstanceEntity.getEndTime() == null) {
        logger.info("historicProcessInstanceId is running");

        return null;
    }

    historicProcessInstanceEntity.setEndActivityId(null);
    historicProcessInstanceEntity.setEndTime(null);

    String processDefinitionId = historicProcessInstanceEntity
            .getProcessDefinitionId();
    String initiator = historicProcessInstanceEntity.getStartUserId();
    String businessKey = historicProcessInstanceEntity.getBusinessKey();

    ProcessDefinitionEntity processDefinition = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(commandContext);

    // ExecutionEntity processInstance = processDefinition
    // .createProcessInstance(businessKey);
    ExecutionEntity processInstance = this.createProcessInstance(
            historicProcessInstanceEntity.getId(), businessKey, initiator,
            processDefinition);

    try {
        Authentication.setAuthenticatedUserId(initiator);
        // start
        processInstance.start();
    } finally {
        Authentication.setAuthenticatedUserId(null);
    }

    return null;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:39,代码来源:ReOpenProcessCmd.java


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