@Override
    public WorkflowProcess clone() throws CloneNotSupportedException {
        WorkflowProcess cloneProcess = (WorkflowProcess) super.clone();
        cloneProcess.setStartEvent((StartEvent) this.startEvent.clone());
        cloneProcess.setEndEvent((EndEvent) this.endEvent.clone());
        Map<String, WorkflowTask> nameToTaskMap = new HashMap<>();

        StartEvent startEvent = cloneProcess.getStartEvent();
        Map<WorkflowAction, List<ConditionNextElement>> workflowActionListMap = startEvent.getActionToNextElementMap();
        Queue<Map<WorkflowAction, List<ConditionNextElement>>> queue = new LinkedBlockingQueue<>();
        if (MapUtils.isNotEmpty(workflowActionListMap)) {
            queue.add(workflowActionListMap);
        }
        while (!queue.isEmpty()) {
            workflowActionListMap = queue.remove();
            for (List<ConditionNextElement> conditionNextElements : workflowActionListMap.values()) {
                for (ConditionNextElement conditionNextElement : conditionNextElements) {
                    Element element = conditionNextElement.getElement();
                    if (element instanceof WorkflowTask) {
                        WorkflowTask workflowTask = (WorkflowTask) element;
                        nameToTaskMap.put(workflowTask.getName(), workflowTask);
                    }
                    if (element instanceof NextableElement) {
                        NextableElement nextableElement = (NextableElement) element;
                        Map<WorkflowAction, List<ConditionNextElement>> childListMap =
                                nextableElement.getActionToNextElementMap();
                        if (MapUtils.isNotEmpty(childListMap)) {
                            queue.add(childListMap);
                        }
                    }
                }
            }
        }

        cloneProcess.setNameToTaskMap(nameToTaskMap);
        Map<ProcessEvent, List<ProcessEventListener>> cloneListeners = Maps.newHashMap();
        cloneListeners.putAll(listeners);
        cloneProcess.listeners = cloneListeners;

        return cloneProcess;
    }
Get workflow task by task name.

@param name workflow task name.
@return workflow task info.
inlong-manager/manager-workflow/src/main/java/org/apache/inlong/manager/workflow/definition/WorkflowProcess.java