@Override
    public WorkflowProcess defineProcess() {
        // Configuration process
        WorkflowProcess process = new WorkflowProcess();
        process.setName(getProcessName().name());
        process.setType(getProcessName().getDisplayName());
        process.setDisplayName(getProcessName().getDisplayName());
        process.setFormClass(GroupResourceProcessForm.class);
        process.setVersion(1);
        process.setHidden(1);

        // Set up the listener
        process.addListener(updateGroupListener);
        process.addListener(updateGroupCompleteListener);
        process.addListener(updateGroupFailedListener);

        // Start node
        StartEvent startEvent = new StartEvent();
        process.setStartEvent(startEvent);

        // Delete Source
        ServiceTask deleteSourceTask = new ServiceTask();
        deleteSourceTask.setName("DeleteSource");
        deleteSourceTask.setDisplayName("Group-DeleteSource");
        deleteSourceTask.setServiceTaskType(ServiceTaskType.DELETE_SOURCE);
        deleteSourceTask.setListenerFactory(groupTaskListenerFactory);
        process.addTask(deleteSourceTask);

        // Delete MQ
        ServiceTask deleteMQTask = new ServiceTask();
        deleteMQTask.setName("DeleteMQ");
        deleteMQTask.setDisplayName("Group-DeleteMQ");
        deleteMQTask.setServiceTaskType(ServiceTaskType.DELETE_MQ);
        deleteMQTask.setListenerFactory(groupTaskListenerFactory);
        process.addTask(deleteMQTask);

        // Delete Sort
        ServiceTask deleteSortTask = new ServiceTask();
        deleteSortTask.setName("DeleteSort");
        deleteSortTask.setDisplayName("Group-DeleteSort");
        deleteSortTask.setServiceTaskType(ServiceTaskType.DELETE_SORT);
        deleteSortTask.setListenerFactory(groupTaskListenerFactory);
        process.addTask(deleteSortTask);

        // No need to delete the sink because we should not affect the existing data in the sink

        // End node
        EndEvent endEvent = new EndEvent();
        process.setEndEvent(endEvent);

        startEvent.addNext(deleteSourceTask);
        deleteSourceTask.addNext(deleteMQTask);
        deleteMQTask.addNext(deleteSortTask);
        deleteSortTask.addNext(endEvent);

        return process;
    }
Delete workflow definition for inlong group
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/DeleteGroupWorkflowDefinition.java