org.activiti.engine.impl.cmd.GetDeploymentProcessDefinitionCmd Java Examples

The following examples show how to use org.activiti.engine.impl.cmd.GetDeploymentProcessDefinitionCmd. 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: RollbackTaskCmd.java    From lemon with Apache License 2.0 6 votes vote down vote up
/**
 * 查找回退的目的节点.
 */
public ActivityImpl findTargetActivity(CommandContext commandContext,
        TaskEntity taskEntity) {
    if (activityId == null) {
        String historyTaskId = this.findNearestUserTask(commandContext);
        HistoricTaskInstanceEntity historicTaskInstanceEntity = commandContext
                .getHistoricTaskInstanceEntityManager()
                .findHistoricTaskInstanceById(historyTaskId);
        this.activityId = historicTaskInstanceEntity.getTaskDefinitionKey();
    }

    String processDefinitionId = taskEntity.getProcessDefinitionId();
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(commandContext);

    return processDefinitionEntity.findActivity(activityId);
}
 
Example #2
Source File: RollbackTaskCmd.java    From lemon with Apache License 2.0 5 votes vote down vote up
/**
 * 获得历史节点对应的节点信息.
 */
public ActivityImpl getActivity(
        HistoricActivityInstanceEntity historicActivityInstanceEntity) {
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            historicActivityInstanceEntity.getProcessDefinitionId())
            .execute(Context.getCommandContext());

    return processDefinitionEntity
            .findActivity(historicActivityInstanceEntity.getActivityId());
}
 
Example #3
Source File: ActivitiHistoryGraphBuilder.java    From lemon with Apache License 2.0 5 votes vote down vote up
/**
 * 根据流程实例id获取对应的流程定义.
 */
public void fetchProcessDefinitionEntity() {
    String processDefinitionId = Context.getCommandContext()
            .getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId)
            .getProcessDefinitionId();
    GetDeploymentProcessDefinitionCmd cmd = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId);
    processDefinitionEntity = cmd.execute(Context.getCommandContext());
}
 
Example #4
Source File: RollbackCmd.java    From lemon with Apache License 2.0 5 votes vote down vote up
public ActivityImpl getActivity(
        HistoricActivityInstanceEntity historicActivityInstanceEntity) {
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            historicActivityInstanceEntity.getProcessDefinitionId())
            .execute(Context.getCommandContext());

    return processDefinitionEntity
            .findActivity(historicActivityInstanceEntity.getActivityId());
}
 
Example #5
Source File: ReOpenProcessCmd.java    From lemon with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #6
Source File: WithdrawTaskCmd.java    From lemon with Apache License 2.0 5 votes vote down vote up
public ActivityImpl getActivity(
        HistoricActivityInstanceEntity historicActivityInstanceEntity) {
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            historicActivityInstanceEntity.getProcessDefinitionId())
            .execute(Context.getCommandContext());

    return processDefinitionEntity
            .findActivity(historicActivityInstanceEntity.getActivityId());
}
 
Example #7
Source File: ProcessDefinitionDiagramCmd.java    From lemon with Apache License 2.0 5 votes vote down vote up
public InputStream execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(commandContext);
    String diagramResourceName = processDefinition.getDiagramResourceName();
    String deploymentId = processDefinition.getDeploymentId();

    if (deploymentId != null) {
        byte[] bytes = commandContext
                .getResourceEntityManager()
                .findResourceByDeploymentIdAndResourceName(deploymentId,
                        diagramResourceName).getBytes();
        InputStream inputStream = new ByteArrayInputStream(bytes);

        return inputStream;
    }

    GetBpmnModelCmd getBpmnModelCmd = new GetBpmnModelCmd(
            processDefinitionId);
    BpmnModel bpmnModel = getBpmnModelCmd.execute(commandContext);
    ProcessEngineConfiguration processEngineConfiguration = Context
            .getProcessEngineConfiguration();
    InputStream is = new DefaultProcessDiagramGenerator().generateDiagram(
            bpmnModel, "png",
            processEngineConfiguration.getActivityFontName(),
            processEngineConfiguration.getLabelFontName(), null);

    return is;
}
 
Example #8
Source File: CheckWithdrawTaskCmd.java    From lemon with Apache License 2.0 5 votes vote down vote up
public ActivityImpl getActivity(
        HistoricActivityInstanceEntity historicActivityInstanceEntity) {
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            historicActivityInstanceEntity.getProcessDefinitionId())
            .execute(Context.getCommandContext());

    return processDefinitionEntity
            .findActivity(historicActivityInstanceEntity.getActivityId());
}
 
Example #9
Source File: FindTaskDefinitionsCmd.java    From lemon with Apache License 2.0 5 votes vote down vote up
public List<TaskDefinition> execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(commandContext);

    List<TaskDefinition> taskDefinitions = new ArrayList<TaskDefinition>();
    taskDefinitions.addAll(processDefinitionEntity.getTaskDefinitions()
            .values());

    return taskDefinitions;
}
 
Example #10
Source File: ActivitiInternalProcessConnector.java    From lemon with Apache License 2.0 5 votes vote down vote up
/**
 * 获得提交节点
 */
public String findFirstUserTaskActivityId(String processDefinitionId,
        String initiator) {
    GetDeploymentProcessDefinitionCmd getDeploymentProcessDefinitionCmd = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId);
    ProcessDefinitionEntity processDefinitionEntity = processEngine
            .getManagementService().executeCommand(
                    getDeploymentProcessDefinitionCmd);

    ActivityImpl startActivity = processDefinitionEntity.getInitial();

    if (startActivity.getOutgoingTransitions().size() != 1) {
        throw new IllegalStateException(
                "start activity outgoing transitions cannot more than 1, now is : "
                        + startActivity.getOutgoingTransitions().size());
    }

    PvmTransition pvmTransition = startActivity.getOutgoingTransitions()
            .get(0);
    PvmActivity targetActivity = pvmTransition.getDestination();

    if (!"userTask".equals(targetActivity.getProperty("type"))) {
        logger.info("first activity is not userTask, just skip");

        return null;
    }

    return targetActivity.getId();
}
 
Example #11
Source File: ActivitiInternalProcessConnector.java    From lemon with Apache License 2.0 5 votes vote down vote up
/**
 * 获得开始事件id.
 */
public String findInitialActivityId(String processDefinitionId) {
    GetDeploymentProcessDefinitionCmd getDeploymentProcessDefinitionCmd = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId);
    ProcessDefinitionEntity processDefinition = processEngine
            .getManagementService().executeCommand(
                    getDeploymentProcessDefinitionCmd);

    return processDefinition.getInitial().getId();
}
 
Example #12
Source File: FunctionEventListener.java    From lemon with Apache License 2.0 5 votes vote down vote up
public String findActivityName(String activityId, String processDefinitionId) {
    if ("".equals(activityId)) {
        return "";
    }

    ProcessDefinitionEntity processDefinition = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(Context.getCommandContext());

    return (String) processDefinition.findActivity(activityId).getProperty(
            "name");
}
 
Example #13
Source File: CustomProcessDiagramGenerator.java    From lemon with Apache License 2.0 4 votes vote down vote up
public InputStream generateDiagram(String processInstanceId)
        throws IOException {
    HistoricProcessInstance historicProcessInstance = Context
            .getCommandContext().getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);
    String processDefinitionId = historicProcessInstance
            .getProcessDefinitionId();
    GetBpmnModelCmd getBpmnModelCmd = new GetBpmnModelCmd(
            processDefinitionId);
    BpmnModel bpmnModel = getBpmnModelCmd.execute(Context
            .getCommandContext());

    // Point point = getMinXAndMinY(bpmnModel);
    // this.minX = point.x;
    // this.minY = point.y;
    // this.minX = (this.minX <= 5) ? 5 : this.minX;
    // this.minY = (this.minY <= 5) ? 5 : this.minY;
    // this.minX -= 5;
    // this.minY -= 5;
    ProcessDefinitionEntity definition = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(Context.getCommandContext());
    String diagramResourceName = definition.getDiagramResourceName();
    String deploymentId = definition.getDeploymentId();
    byte[] bytes = Context
            .getCommandContext()
            .getResourceEntityManager()
            .findResourceByDeploymentIdAndResourceName(deploymentId,
                    diagramResourceName).getBytes();
    InputStream originDiagram = new ByteArrayInputStream(bytes);
    BufferedImage image = ImageIO.read(originDiagram);

    HistoricActivityInstanceQueryImpl historicActivityInstanceQueryImpl = new HistoricActivityInstanceQueryImpl();
    historicActivityInstanceQueryImpl.processInstanceId(processInstanceId)
            .orderByHistoricActivityInstanceStartTime().asc();

    Page page = new Page(0, 100);
    List<HistoricActivityInstance> activityInstances = Context
            .getCommandContext()
            .getHistoricActivityInstanceEntityManager()
            .findHistoricActivityInstancesByQueryCriteria(
                    historicActivityInstanceQueryImpl, page);

    this.drawHistoryFlow(image, processInstanceId);

    for (HistoricActivityInstance historicActivityInstance : activityInstances) {
        String historicActivityId = historicActivityInstance
                .getActivityId();
        ActivityImpl activity = definition.findActivity(historicActivityId);

        if (activity != null) {
            if (historicActivityInstance.getEndTime() == null) {
                // 节点正在运行中
                signRunningNode(image, activity.getX() - this.minX,
                        activity.getY() - this.minY, activity.getWidth(),
                        activity.getHeight(),
                        historicActivityInstance.getActivityType());
            } else {
                String deleteReason = null;

                if (historicActivityInstance.getTaskId() != null) {
                    deleteReason = Context
                            .getCommandContext()
                            .getHistoricTaskInstanceEntityManager()
                            .findHistoricTaskInstanceById(
                                    historicActivityInstance.getTaskId())
                            .getDeleteReason();
                }

                // 节点已经结束
                if ("跳过".equals(deleteReason)) {
                    signSkipNode(image, activity.getX() - this.minX,
                            activity.getY() - this.minY,
                            activity.getWidth(), activity.getHeight(),
                            historicActivityInstance.getActivityType());
                } else {
                    signHistoryNode(image, activity.getX() - this.minX,
                            activity.getY() - this.minY,
                            activity.getWidth(), activity.getHeight(),
                            historicActivityInstance.getActivityType());
                }
            }
        }
    }

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    String formatName = getDiagramExtension(diagramResourceName);
    ImageIO.write(image, formatName, out);

    return new ByteArrayInputStream(out.toByteArray());
}
 
Example #14
Source File: RollbackTaskCmd.java    From lemon with Apache License 2.0 4 votes vote down vote up
/**
 * 根据任务历史,创建待办任务.
 */
public void processHistoryTask(CommandContext commandContext,
        TaskEntity taskEntity,
        HistoricTaskInstanceEntity historicTaskInstanceEntity,
        HistoricActivityInstanceEntity historicActivityInstanceEntity) {
    if (this.userId == null) {
        if (this.useLastAssignee) {
            this.userId = historicTaskInstanceEntity.getAssignee();
        } else {
            String processDefinitionId = taskEntity
                    .getProcessDefinitionId();
            ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
                    processDefinitionId).execute(commandContext);
            TaskDefinition taskDefinition = processDefinitionEntity
                    .getTaskDefinitions().get(
                            historicTaskInstanceEntity
                                    .getTaskDefinitionKey());

            if (taskDefinition == null) {
                String message = "cannot find taskDefinition : "
                        + historicTaskInstanceEntity.getTaskDefinitionKey();
                logger.info(message);
                throw new IllegalStateException(message);
            }

            if (taskDefinition.getAssigneeExpression() != null) {
                logger.info("assignee expression is null : {}",
                        taskDefinition.getKey());
                this.userId = (String) taskDefinition
                        .getAssigneeExpression().getValue(taskEntity);
            }
        }
    }

    /*
     * historicTaskInstanceEntity.setEndTime(null); historicTaskInstanceEntity.setDurationInMillis(null);
     * historicActivityInstanceEntity.setEndTime(null); historicActivityInstanceEntity.setDurationInMillis(null);
     */

    // 创建新任务
    TaskEntity task = TaskEntity.create(new Date());
    task.setProcessDefinitionId(historicTaskInstanceEntity
            .getProcessDefinitionId());
    // task.setId(historicTaskInstanceEntity.getId());
    task.setAssigneeWithoutCascade(userId);
    task.setParentTaskIdWithoutCascade(historicTaskInstanceEntity
            .getParentTaskId());
    task.setNameWithoutCascade(historicTaskInstanceEntity.getName());
    task.setTaskDefinitionKey(historicTaskInstanceEntity
            .getTaskDefinitionKey());
    task.setExecutionId(historicTaskInstanceEntity.getExecutionId());
    task.setPriority(historicTaskInstanceEntity.getPriority());
    task.setProcessInstanceId(historicTaskInstanceEntity
            .getProcessInstanceId());
    task.setExecutionId(historicTaskInstanceEntity.getExecutionId());
    task.setDescriptionWithoutCascade(historicTaskInstanceEntity
            .getDescription());
    task.setTenantId(historicTaskInstanceEntity.getTenantId());

    Context.getCommandContext().getTaskEntityManager().insert(task);

    // 把流程指向任务对应的节点
    ExecutionEntity executionEntity = Context.getCommandContext()
            .getExecutionEntityManager()
            .findExecutionById(historicTaskInstanceEntity.getExecutionId());
    executionEntity
            .setActivity(getActivity(historicActivityInstanceEntity));

    // 创建HistoricActivityInstance
    Context.getCommandContext().getHistoryManager()
            .recordActivityStart(executionEntity);

    // 创建HistoricTaskInstance
    Context.getCommandContext().getHistoryManager()
            .recordTaskCreated(task, executionEntity);
    Context.getCommandContext().getHistoryManager().recordTaskId(task);
    // 更新ACT_HI_ACTIVITY里的assignee字段
    Context.getCommandContext().getHistoryManager()
            .recordTaskAssignment(task);

    try {
        // humanTask
        this.createHumanTask(task, historicTaskInstanceEntity);
    } catch (Exception ex) {
        logger.error(ex.getMessage(), ex);
    }
}
 
Example #15
Source File: RepositoryServiceImpl.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public ProcessDefinition getProcessDefinition(String processDefinitionId) {
  return commandExecutor.execute(new GetDeploymentProcessDefinitionCmd(processDefinitionId));
}
 
Example #16
Source File: RollbackTaskCmd.java    From lemon with Apache License 2.0 4 votes vote down vote up
/**
 * 删除未完成任务.
 */
public void deleteActiveTask(TaskEntity taskEntity) {
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            taskEntity.getProcessDefinitionId()).execute(Context
            .getCommandContext());

    ActivityImpl activityImpl = processDefinitionEntity
            .findActivity(taskEntity.getTaskDefinitionKey());

    if (this.isMultiInstance(activityImpl)) {
        logger.info("{} is multiInstance", taskEntity.getId());
        this.multiInstanceExecutionIds.add(taskEntity.getExecution()
                .getParent().getId());
        logger.info("append : {}", taskEntity.getExecution().getParent()
                .getId());
    }

    // TaskEntity taskEntity = Context.getCommandContext()
    // .getTaskEntityManager().findTaskById(this.taskId);
    Context.getCommandContext().getTaskEntityManager()
            .deleteTask(taskEntity, "驳回", false);

    JdbcTemplate jdbcTemplate = ApplicationContextHelper
            .getBean(JdbcTemplate.class);
    List<Map<String, Object>> list = jdbcTemplate
            .queryForList(
                    "SELECT * FROM ACT_HI_ACTINST WHERE TASK_ID_=? AND END_TIME_ IS NULL",
                    taskId);
    Date now = new Date();

    for (Map<String, Object> map : list) {
        Date startTime = (Date) map.get("START_TIME_");
        long duration = now.getTime() - startTime.getTime();
        jdbcTemplate
                .update("UPDATE ACT_HI_ACTINST SET END_TIME_=?,DURATION_=? WHERE ID_=?",
                        now, duration, map.get("ID_"));
    }

    // 处理humanTask
    HumanTaskConnector humanTaskConnector = ApplicationContextHelper
            .getBean(HumanTaskConnector.class);
    HumanTaskDTO humanTaskDto = humanTaskConnector
            .findHumanTaskByTaskId(this.taskId);
    humanTaskDto.setCompleteTime(new Date());
    humanTaskDto.setStatus("rollback");
    humanTaskConnector.saveHumanTask(humanTaskDto);
}
 
Example #17
Source File: UpdateProcessInstanceNameEventListener.java    From lemon with Apache License 2.0 4 votes vote down vote up
protected void onInitialized(ActivitiEvent event) {
    if (!(event instanceof ActivitiEntityEventImpl)) {
        return;
    }

    ActivitiEntityEventImpl activitiEntityEventImpl = (ActivitiEntityEventImpl) event;
    Object entity = activitiEntityEventImpl.getEntity();

    if (!(entity instanceof ExecutionEntity)) {
        return;
    }

    ActivitiEventType activitiEventType = activitiEntityEventImpl.getType();

    if (activitiEventType != ActivitiEventType.ENTITY_INITIALIZED) {
        return;
    }

    ExecutionEntity executionEntity = (ExecutionEntity) entity;

    if (!executionEntity.isProcessInstanceType()) {
        return;
    }

    String processInstanceId = executionEntity.getId();
    String processDefinitionId = executionEntity.getProcessDefinitionId();
    CommandContext commandContext = Context.getCommandContext();
    ProcessDefinitionEntity processDefinition = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(commandContext);

    // {流程标题:title}-{发起人:startUser}-{发起时间:startTime}
    String processDefinitionName = processDefinition.getName();

    if (processDefinitionName == null) {
        processDefinitionName = processDefinition.getKey();
    }

    String userId = Authentication.getAuthenticatedUserId();
    String displayName = userConnector.findById(userId).getDisplayName();
    String processInstanceName = processDefinitionName + "-" + displayName
            + "-"
            + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date());
    // runtime
    executionEntity.setName(processInstanceName);

    // history
    HistoricProcessInstanceEntity historicProcessInstanceEntity = commandContext
            .getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);
    historicProcessInstanceEntity.setName(processInstanceName);
}
 
Example #18
Source File: RepositoryServiceImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public ReadOnlyProcessDefinition getDeployedProcessDefinition(String processDefinitionId) {
    return (ReadOnlyProcessDefinition) commandExecutor.execute(new GetDeploymentProcessDefinitionCmd(processDefinitionId));
}
 
Example #19
Source File: SyncProcessCmd.java    From lemon with Apache License 2.0 4 votes vote down vote up
public Void execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId).execute(commandContext);
    String processDefinitionKey = processDefinitionEntity.getKey();
    int processDefinitionVersion = processDefinitionEntity.getVersion();
    BpmConfBaseManager bpmConfBaseManager = getBpmConfBaseManager();
    BpmConfBase bpmConfBase = bpmConfBaseManager
            .findUnique(
                    "from BpmConfBase where processDefinitionKey=? and processDefinitionVersion=?",
                    processDefinitionKey, processDefinitionVersion);

    if (bpmConfBase == null) {
        bpmConfBase = new BpmConfBase();
        bpmConfBase.setProcessDefinitionId(processDefinitionId);
        bpmConfBase.setProcessDefinitionKey(processDefinitionKey);
        bpmConfBase.setProcessDefinitionVersion(processDefinitionVersion);
        bpmConfBaseManager.save(bpmConfBase);
    } else if (bpmConfBase.getProcessDefinitionId() == null) {
        bpmConfBase.setProcessDefinitionId(processDefinitionId);
        bpmConfBaseManager.save(bpmConfBase);
    }

    BpmnModel bpmnModel = new GetBpmnModelCmd(processDefinitionId)
            .execute(commandContext);
    Graph graph = new FindGraphCmd(processDefinitionId)
            .execute(commandContext);
    this.processGlobal(bpmnModel, 1, bpmConfBase);

    int priority = 2;

    for (Node node : graph.getNodes()) {
        if ("exclusiveGateway".equals(node.getType())) {
            continue;
        } else if ("userTask".equals(node.getType())) {
            this.processUserTask(node, bpmnModel, priority++, bpmConfBase);
        } else if ("startEvent".equals(node.getType())) {
            this.processStartEvent(node, bpmnModel, priority++, bpmConfBase);
        } else if ("endEvent".equals(node.getType())) {
            this.processEndEvent(node, bpmnModel, priority++, bpmConfBase);
        }
    }

    return null;
}
 
Example #20
Source File: RepositoryServiceImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
public ProcessDefinition getProcessDefinition(String processDefinitionId) {
    return commandExecutor.execute(new GetDeploymentProcessDefinitionCmd(processDefinitionId));
}
 
Example #21
Source File: ActivitiGraphBuilder.java    From lemon with Apache License 2.0 4 votes vote down vote up
/**
 * 获取流程定义.
 */
public void fetchProcessDefinitionEntity() {
    GetDeploymentProcessDefinitionCmd cmd = new GetDeploymentProcessDefinitionCmd(
            processDefinitionId);
    processDefinitionEntity = cmd.execute(Context.getCommandContext());
}
 
Example #22
Source File: RepositoryServiceImpl.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public ProcessDefinition getDeployedProcessDefinition(String processDefinitionId) {
  return commandExecutor.execute(new GetDeploymentProcessDefinitionCmd(processDefinitionId));
}