use of org.apache.inlong.manager.common.pojo.workflow.ElementDTO 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;
}
use of org.apache.inlong.manager.common.pojo.workflow.ElementDTO in project incubator-inlong by apache.
the class WorkflowQueryServiceImpl method addNext.
private void addNext(NextableElement nextableElement, ElementDTO elementDTO, WorkflowContext context, Map<String, TaskStatus> nameToStatusMap) {
for (Element element : nextableElement.getNextList(context)) {
ElementDTO nextElement = new ElementDTO();
nextElement.setName(element.getName());
nextElement.setDisplayName(element.getDisplayName());
if (element instanceof UserTask) {
nextElement.setApprovers(((UserTask) element).getApproverAssign().assign(context));
nextElement.setStatus(nameToStatusMap.get(element.getName()));
}
elementDTO.getNext().add(nextElement);
if (!(element instanceof NextableElement)) {
continue;
}
addNext((NextableElement) element, nextElement, context, nameToStatusMap);
}
}
Aggregations