private boolean isNullOrTerminated(FlinkInfo flinkInfo) throws Exception {
        JobDetailsInfo jobDetailsInfo = FlinkService.getInstance().getJobDetail(flinkInfo);
        boolean terminated = jobDetailsInfo == null || jobDetailsInfo.getJobStatus() == null;
        if (terminated) {
            log.warn("job detail or job status was null for [{}]", flinkInfo.getJobId());
            return true;
        }

        terminated = jobDetailsInfo.getJobStatus().isTerminalState();
        log.warn("job terminated state was [{}] for [{}]", terminated, jobDetailsInfo);
        return terminated;
    }
Check whether the job was terminated by the given job id.
inlong-manager/manager-plugins/base/src/main/java/org/apache/inlong/manager/plugin/flink/FlinkOperation.java