public static long genTaskCode(String url, String token) {
        try {
            Map<String, String> header = buildHeader(token);

            Map<String, String> queryParams = new HashMap<>();
            queryParams.put(DS_TASK_GEN_NUM, DS_DEFAULT_TASK_GEN_NUM);

            JsonObject response = executeHttpRequest(url, GET, queryParams, header);

            JsonArray data = response.get(DS_RESPONSE_DATA).getAsJsonArray();

            LOGGER.info("Generate task code success, task code data: {}", data);
            return data != null && data.size() == 1 ? data.get(0).getAsLong() : 0;

        } catch (JsonParseException e) {
            LOGGER.error("JsonParseException during generate task code", e);
            throw new DolphinScheduleException(
                    JSON_PARSE_ERROR,
                    String.format("Error generate task code at URL: %s", url));

        } catch (DolphinScheduleException e) {
            LOGGER.info("generate task code failed: {}", e.getMessage());
            throw new DolphinScheduleException(
                    GEN_TASK_CODE_FAILED,
                    String.format("Error generate task code at URL: %s", url));
        }
    }
Generates a new task code in DolphinScheduler.

@param url   The base URL of the DolphinScheduler API.
@param token The authentication token to be used in the request header.
@return The task code (ID) if generation is successful, or 0 if an error occurs.
inlong-manager/manager-schedule/src/main/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleUtils.java