{"record":{"id":"ba1b37fd3b3187e4","repo":"flowable/flowable-engine","slug":"deploymentid-is-null-ba1b37","errorCode":null,"errorMessage":"deploymentId is null","messagePattern":"deploymentId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetDeploymentResourceNamesCmd.java","lineNumber":38,"sourceCode":"import org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.eventregistry.impl.util.CommandContextUtil;\n\n/**\n * @author Joram Barrez\n */\npublic class GetDeploymentResourceNamesCmd implements Command<List<String>>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String deploymentId;\n\n    public GetDeploymentResourceNamesCmd(String deploymentId) {\n        this.deploymentId = deploymentId;\n    }\n\n    @Override\n    public List<String> execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n\n        return CommandContextUtil.getDeploymentEntityManager(commandContext).getDeploymentResourceNames(deploymentId);\n    }\n\n}\n","sourceCodeStart":20,"sourceCodeEnd":45,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetDeploymentResourceNamesCmd.java#L20-L45","documentation":"GetDeploymentResourceNamesCmd returns the resource name list for a deployment. A null deploymentId is rejected immediately with FlowableIllegalArgumentException because the deployment manager query cannot run without the id.","triggerScenarios":"Calling the corresponding repository/EventRepositoryService API or executing the command with deploymentId null, typically because the deployment id variable was never assigned from a deploy() result.","commonSituations":"Ignoring the EventDeployment returned by deploy(); failed deployment left the id unset; passing a process-engine deployment id variable that is null in this context.","solutions":["Capture the id from EventRepositoryService.createDeployment().addX(...).deploy().getId() and pass it","Null-check the id before invoking the command","Persist the deployment id (e.g. in config/DB) instead of re-resolving it at call time"],"exampleFix":"// before\nList<String> names = eventRepositoryService.getDeploymentResourceNames(deploymentId); // null\n// after\nEventDeployment dep = eventRepositoryService.createDeployment().addClasspathResource(\"order.event.json\").deploy();\nList<String> names = eventRepositoryService.getDeploymentResourceNames(dep.getId());","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.isEmpty()) {\n    throw new IllegalArgumentException(\"deploymentId required\");\n}","typeGuard":"boolean hasDeploymentId = deploymentId != null && !deploymentId.trim().isEmpty();","tryCatchPattern":"try {\n    List<String> names = eventRepositoryService.getDeploymentResourceNames(deploymentId);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"deploymentId missing: {}\", e.getMessage());\n}","preventionTips":["Always propagate the id from deploy() results","Assert non-null ids in service-layer helpers","Unit test command construction with null args to catch regressions"],"tags":["flowable","event-registry","null-argument","deployment"],"backgroundTag":"null-argument","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"}