Search in sources :

Example 1 with WorkflowBriefDTO

use of org.apache.inlong.manager.common.pojo.workflow.WorkflowBriefDTO in project incubator-inlong by apache.

the class WorkflowQueryServiceImpl method getProcessDetail.

private ProcessDetailResponse getProcessDetail(Integer processId, WorkflowProcessEntity processEntity) {
    List<WorkflowTaskEntity> taskList = this.listApproveHistory(processId);
    List<TaskResponse> history = taskList.stream().map(WorkflowBeanUtils::fromTaskEntity).collect(Collectors.toList());
    WorkflowBriefDTO workflowDTO = this.getBriefFromProcessEntity(processEntity);
    ProcessDetailResponse processDetail = new ProcessDetailResponse();
    processDetail.setProcessInfo(WorkflowBeanUtils.fromProcessEntity(processEntity));
    processDetail.setTaskHistory(history);
    processDetail.setWorkflow(workflowDTO);
    return processDetail;
}
Also used : WorkflowBriefDTO(org.apache.inlong.manager.common.pojo.workflow.WorkflowBriefDTO) ProcessDetailResponse(org.apache.inlong.manager.common.pojo.workflow.ProcessDetailResponse) WorkflowTaskEntity(org.apache.inlong.manager.dao.entity.WorkflowTaskEntity) TaskResponse(org.apache.inlong.manager.common.pojo.workflow.TaskResponse)

Example 2 with WorkflowBriefDTO

use of org.apache.inlong.manager.common.pojo.workflow.WorkflowBriefDTO in project incubator-inlong by apache.

the class WorkflowQueryServiceImpl method getBriefFromProcessEntity.

private WorkflowBriefDTO getBriefFromProcessEntity(WorkflowProcessEntity processEntity) {
    WorkflowProcess process = definitionRepository.get(processEntity.getName());
    if (process == null) {
        return null;
    }
    Map<String, TaskStatus> nameStatusMap = this.getTaskNameStatusMap(processEntity);
    ElementDTO elementDTO = new ElementDTO();
    StartEvent startEvent = process.getStartEvent();
    elementDTO.setName(startEvent.getName());
    elementDTO.setDisplayName(startEvent.getDisplayName());
    WorkflowContext context = WorkflowBeanUtils.buildContext(process, processEntity);
    addNext(startEvent, elementDTO, context, nameStatusMap);
    WorkflowBriefDTO briefDTO = new WorkflowBriefDTO();
    briefDTO.setName(process.getName());
    briefDTO.setDisplayName(process.getDisplayName());
    briefDTO.setType(process.getType());
    briefDTO.setStartEvent(elementDTO);
    return briefDTO;
}
Also used : WorkflowBriefDTO(org.apache.inlong.manager.common.pojo.workflow.WorkflowBriefDTO) ElementDTO(org.apache.inlong.manager.common.pojo.workflow.ElementDTO) WorkflowContext(org.apache.inlong.manager.workflow.WorkflowContext) StartEvent(org.apache.inlong.manager.workflow.definition.StartEvent) TaskStatus(org.apache.inlong.manager.common.enums.TaskStatus) WorkflowProcess(org.apache.inlong.manager.workflow.definition.WorkflowProcess)

Aggregations

WorkflowBriefDTO (org.apache.inlong.manager.common.pojo.workflow.WorkflowBriefDTO)2 TaskStatus (org.apache.inlong.manager.common.enums.TaskStatus)1 ElementDTO (org.apache.inlong.manager.common.pojo.workflow.ElementDTO)1 ProcessDetailResponse (org.apache.inlong.manager.common.pojo.workflow.ProcessDetailResponse)1 TaskResponse (org.apache.inlong.manager.common.pojo.workflow.TaskResponse)1 WorkflowTaskEntity (org.apache.inlong.manager.dao.entity.WorkflowTaskEntity)1 WorkflowContext (org.apache.inlong.manager.workflow.WorkflowContext)1 StartEvent (org.apache.inlong.manager.workflow.definition.StartEvent)1 WorkflowProcess (org.apache.inlong.manager.workflow.definition.WorkflowProcess)1