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

        // Set up the listener
        process.addListener(updateStreamListener);
        process.addListener(updateStreamCompleteListener);
        process.addListener(updateStreamFailedListener);

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

        // Delete Source
        ServiceTask deleteDataSourceTask = new ServiceTask();
        deleteDataSourceTask.setName("DeleteSource");
        deleteDataSourceTask.setDisplayName("Stream-DeleteSource");
        deleteDataSourceTask.setServiceTaskType(ServiceTaskType.DELETE_SOURCE);
        deleteDataSourceTask.setListenerFactory(streamTaskListenerFactory);
        process.addTask(deleteDataSourceTask);

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

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

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

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

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