{"record":{"id":"c97dbd9503e57375","repo":"flowable/flowable-engine","slug":"workerid-must-not-be-empty","errorCode":null,"errorMessage":"workerId must not be empty","messagePattern":"workerId must not be empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractExternalWorkerJobCmd.java","lineNumber":78,"sourceCode":"    }\n\n    protected abstract void runJobLogic(ExternalWorkerJobEntity externalWorkerJob, CommandContext commandContext);\n\n    protected void moveExternalWorkerJobToExecutableJob(ExternalWorkerJobEntity externalWorkerJob, CommandContext commandContext) {\n        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        cmmnEngineConfiguration.getJobServiceConfiguration().getJobManager().moveExternalWorkerJobToExecutableJob(externalWorkerJob);\n\n        cmmnEngineConfiguration.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        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        ExternalWorkerJobEntityManager externalWorkerJobEntityManager = cmmnEngineConfiguration.getJobServiceConfiguration().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\n        return job;\n    }\n}","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractExternalWorkerJobCmd.java#L60-L96","documentation":"FlowableIllegalArgumentException thrown by resolveJob when the workerId passed to the external worker command is null or empty. The workerId identifies which worker is acting on the job and is required for identity-link bookkeeping and validation.","triggerScenarios":"Calling completeBuilder/failureBuilder with an empty workerId, e.g., workerId field never set from configuration or the acquire response.","commonSituations":"Worker application missing its configured worker id (empty env var/config key); passing job id where workerId is expected due to argument order confusion.","solutions":["Pass the same workerId used during job acquisition into the completion/failure builder.","Check application configuration so the worker id is populated (non-empty) at startup.","Swap arguments if job id and worker id were transposed in the builder call."],"exampleFix":"// before\ncmmnExternalWorkerServiceProvider.completeBuilder(\"\", externalJobId).complete();\n// after\ncmmnExternalWorkerServiceProvider.completeBuilder(\"order-worker-1\", externalJobId).complete();","handlingStrategy":"validation","validationCode":"if (workerId == null || workerId.isBlank())\n    throw new IllegalArgumentException(\"workerId must be configured before handling external worker jobs\");","typeGuard":null,"tryCatchPattern":"try { completeBuilder(workerId, externalJobId).complete(); }\ncatch (FlowableIllegalArgumentException e) { if (e.getMessage().equals(\"workerId must not be empty\")) { reloadWorkerConfig(); } }","preventionTips":["Validate worker id at application startup, not per job","Use named builder parameters to avoid transposing workerId and externalJobId"],"tags":["cmmn","external-worker","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"}