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;
}
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;
}
Aggregations