Search in sources :

Example 1 with WorkflowApprover

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

the class WorkflowApproverServiceImpl method list.

@Override
public List<WorkflowApprover> list(WorkflowApproverQuery query) {
    List<WorkflowApproverEntity> entityList = workflowApproverMapper.selectByQuery(query);
    List<WorkflowApprover> approverList = CommonBeanUtils.copyListProperties(entityList, WorkflowApprover::new);
    approverList.forEach(config -> {
        WorkflowProcess process = workflowEngine.processDefinitionService().getByName(config.getProcessName());
        if (process != null) {
            config.setProcessDisplayName(process.getDisplayName());
            config.setTaskDisplayName(Optional.ofNullable(process.getTaskByName(config.getTaskName())).map(WorkflowTask::getDisplayName).orElse(null));
        }
    });
    return approverList;
}
Also used : WorkflowApprover(org.apache.inlong.manager.common.pojo.workflow.WorkflowApprover) WorkflowTask(org.apache.inlong.manager.workflow.definition.WorkflowTask) WorkflowApproverEntity(org.apache.inlong.manager.dao.entity.WorkflowApproverEntity) WorkflowProcess(org.apache.inlong.manager.workflow.definition.WorkflowProcess)

Aggregations

WorkflowApprover (org.apache.inlong.manager.common.pojo.workflow.WorkflowApprover)1 WorkflowApproverEntity (org.apache.inlong.manager.dao.entity.WorkflowApproverEntity)1 WorkflowProcess (org.apache.inlong.manager.workflow.definition.WorkflowProcess)1 WorkflowTask (org.apache.inlong.manager.workflow.definition.WorkflowTask)1