{"record":{"id":"19c55dcebb93491f","repo":"flowable/flowable-engine","slug":"externaljobid-must-not-be-empty-19c55d","errorCode":null,"errorMessage":"externalJobId must not be empty","messagePattern":"externalJobId must not be empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractExternalWorkerJobCmd.java","lineNumber":75,"sourceCode":"            // during the execution of the original job\n            new UnlockExclusiveJobCmd(externalWorkerJob, jobServiceConfiguration).execute(commandContext);\n        }\n        return null;\n    }\n\n    protected abstract void runJobLogic(ExternalWorkerJobEntity externalWorkerJob, CommandContext commandContext);\n\n    protected void moveExternalWorkerJobToExecutableJob(ExternalWorkerJobEntity externalWorkerJob, CommandContext commandContext) {\n        jobServiceConfiguration.getJobManager().moveExternalWorkerJobToExecutableJob(externalWorkerJob);\n\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        processEngineConfiguration.getIdentityLinkServiceConfiguration().getIdentityLinkService()\n                .deleteIdentityLinksByScopeIdAndType(externalWorkerJob.getCorrelationId(), ScopeTypes.EXTERNAL_WORKER);\n    }\n\n    protected ExternalWorkerJobEntity resolveJob(CommandContext commandContext) {\n        if (StringUtils.isEmpty(externalJobId)) {\n            throw new FlowableIllegalArgumentException(\"externalJobId must not be empty\");\n        }\n\n        if (StringUtils.isEmpty(workerId)) {\n            throw new FlowableIllegalArgumentException(\"workerId must not be empty\");\n        }\n\n        ExternalWorkerJobEntityManager externalWorkerJobEntityManager = jobServiceConfiguration.getExternalWorkerJobEntityManager();\n\n        ExternalWorkerJobEntity job = externalWorkerJobEntityManager.findById(externalJobId);\n\n        if (job == null) {\n            throw new FlowableObjectNotFoundException(\"No External Worker job found for id: \" + externalJobId, ExternalWorkerJobEntity.class);\n        }\n\n        if (!Objects.equals(workerId, job.getLockOwner())) {\n            throw new FlowableIllegalArgumentException(workerId + \" does not hold a lock on the requested job\");\n        }\n","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractExternalWorkerJobCmd.java#L57-L93","documentation":"resolveJob validates command inputs before touching the database. An empty/blank externalJobId makes it impossible to look up the job, so a FlowableIllegalArgumentException is thrown immediately. This is a guard against client-side mistakes when completing, failing, or unlocking an external worker job.","triggerScenarios":"Invoking any external worker job command (complete/fail/release/unlock) constructed with externalJobId = null or \"\".","commonSituations":"Job id lost when mapping an acquired job DTO back into a command; variable holding the id not initialized; copying job data between systems and dropping the id field.","solutions":["Pass the actual acquired job's id: new CompleteExternalWorkerJobCmd(job.getId(), workerId, variables).","Validate the job id is non-empty in your worker client before building the command.","Check that the acquisition result object is not null before reading its id."],"exampleFix":"// before\nnew CompleteExternalWorkerJobCmd(jobId, workerId, variables); // jobId may be null\n// after\nObjects.requireNonNull(jobId, \"externalJobId required\");\nif (jobId.isBlank()) throw new IllegalArgumentException(\"jobId required\");\nnew CompleteExternalWorkerJobCmd(jobId, workerId, variables);","handlingStrategy":"validation","validationCode":"if (jobId == null || jobId.isBlank()) {\n    throw new IllegalArgumentException(\"externalJobId required\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate job ids as soon as jobs are acquired","Avoid null job id fields in worker DTOs","Log acquired job ids to trace id loss in mapping code"],"tags":["flowable","external-worker","argument-validation"],"backgroundTag":"empty-required-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}