{"record":{"id":"90992b4be69465db","repo":"flowable/flowable-engine","slug":"jobid-and-job-is-null-90992b","errorCode":null,"errorMessage":"jobId and job is null","messagePattern":"jobId and job is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/MoveSuspendedJobToExecutableJobCmd.java","lineNumber":44,"sourceCode":" * @author martin.grofcik\n */\npublic class MoveSuspendedJobToExecutableJobCmd implements Command<Job>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    protected String jobId;\n    protected JobServiceConfiguration jobServiceConfiguration;\n\n    public MoveSuspendedJobToExecutableJobCmd(String jobId, JobServiceConfiguration jobServiceConfiguration) {\n        this.jobId = jobId;\n        this.jobServiceConfiguration = jobServiceConfiguration;\n    }\n\n    @Override\n    public Job execute(CommandContext commandContext) {\n\n        if (jobId == null) {\n            throw new FlowableIllegalArgumentException(\"jobId and job is null\");\n        }\n\n        SuspendedJobEntity job = jobServiceConfiguration.getSuspendedJobEntityManager().findById(jobId);\n        if (job == null) {\n            throw new JobNotFoundException(jobId);\n        }\n        return jobServiceConfiguration.getJobService().activateSuspendedJob(job);\n    }\n\n    public String getJobId() {\n        return jobId;\n    }\n\n}\n","sourceCodeStart":26,"sourceCodeEnd":59,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/MoveSuspendedJobToExecutableJobCmd.java#L26-L59","documentation":"MoveSuspendedJobToExecutableJobCmd.execute() requires a suspended jobId and throws FlowableIllegalArgumentException with message 'jobId and job is null' when it is null. It moves a job from the suspended-job table back to the executable table, which requires a valid id. It can be reached indirectly via activity-behavior execution paths (executeActivityBehavior).","triggerScenarios":"Calling ManagementService.moveSuspendedJobToExecutableJob(jobId) with a null jobId, or the command being executed through suspend/resume activity behavior without an id.","commonSituations":"Resuming suspended jobs programmatically where the id variable was never populated; process definitions or custom behaviors referencing a job id expression that evaluates to null.","solutions":["Null-check the suspended job id before invoking the move.","Verify the expression/variable that supplies the job id in custom behaviors resolves to a real id.","Fix the wrapper/API caller that forwards null ids."],"exampleFix":"// before\nmanagementService.moveSuspendedJobToExecutableJob(suspendedJobId);\n// after\nif (suspendedJobId != null) {\n    managementService.moveSuspendedJobToExecutableJob(suspendedJobId);\n}","handlingStrategy":"validation","validationCode":"if (suspendedJobId == null || suspendedJobId.isEmpty()) throw new IllegalArgumentException(\"suspended jobId required\");","typeGuard":"boolean resumable = suspendedJob != null && suspendedJob.getId() != null;","tryCatchPattern":"try { managementService.moveSuspendedJobToExecutableJob(id); } catch (FlowableIllegalArgumentException e) { log.error(\"Invalid suspended job id: {}\", e.getMessage()); }","preventionTips":["Ensure expressions/variables supplying job ids in custom behaviors are non-null","Null-check before resume/suspend management calls","Test suspend/resume flows with missing-id inputs"],"tags":["flowable","null-argument","suspended-job","illegal-argument"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}