Java Code Examples for org.activiti.engine.impl.persistence.entity.ExecutionEntity#findActiveActivityIds()

The following examples show how to use org.activiti.engine.impl.persistence.entity.ExecutionEntity#findActiveActivityIds() . 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: FindActiveActivityIdsCmd.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
@Override
public List<String> execute(CommandContext commandContext) {
    if (executionId == null) {
        throw new ActivitiIllegalArgumentException("executionId is null");
    }

    ExecutionEntity execution = commandContext
            .getExecutionEntityManager()
            .findExecutionById(executionId);

    if (execution == null) {
        throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class);
    }

    return execution.findActiveActivityIds();
}
 
Example 2
Source File: ProcessInstanceDiagramCmd.java    From activiti-basic with Apache License 2.0 6 votes vote down vote up
public InputStream execute(CommandContext commandContext) {
    ExecutionEntityManager executionEntityManager = commandContext
        .getExecutionEntityManager();
    ExecutionEntity executionEntity = executionEntityManager
        .findExecutionById(processInstanceId);
    List<String> activiityIds = executionEntity.findActiveActivityIds();
    String processDefinitionId = executionEntity.getProcessDefinitionId();

    GetBpmnModelCmd getBpmnModelCmd = new GetBpmnModelCmd(
            processDefinitionId);
    BpmnModel bpmnModel = getBpmnModelCmd.execute(commandContext);

    InputStream is = ProcessDiagramGenerator.generateDiagram(bpmnModel,
            "png", activiityIds);

    return is;
}