{"record":{"id":"8f5660c751c9befe","repo":"flowable/flowable-engine","slug":"deploymentid-is-null-8f5660","errorCode":null,"errorMessage":"deploymentId is null","messagePattern":"deploymentId is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentResourceNamesCmd.java","lineNumber":38,"sourceCode":"import org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.dmn.engine.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-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentResourceNamesCmd.java#L20-L45","documentation":"GetDeploymentResourceNamesCmd executes a command that fetches the list of resource names stored with a DMN deployment. Before querying the deployment entity manager, the command validates its constructor-supplied deploymentId and throws FlowableIllegalArgumentException when it is null. This fails fast because a null id can never match a deployment row.","triggerScenarios":"Calling DmnRepositoryService.getDeploymentResourceNames(null), or constructing new GetDeploymentResourceNamesCmd(null) directly and running it via the management/command executor.","commonSituations":"Developers passing an id obtained from a nullable API result (e.g. a deployment lookup that returned null), unmapped DTO fields, or accidentally forwarding an unset variable instead of a deployment id string.","solutions":["Ensure the deploymentId string is non-null before calling getDeploymentResourceNames; load it from DmnRepositoryService.createDeploymentQuery().singleResult().getId()","Validate the id at the call site and return a meaningful domain error instead of letting the command throw","Check that the deployment actually exists; a null id usually means an earlier lookup failed silently"],"exampleFix":"// before\nList<String> names = dmnRepositoryService.getDeploymentResourceNames(deploymentId);\n// after\nif (deploymentId == null || deploymentId.isEmpty()) {\n    throw new IllegalStateException(\"deploymentId must be provided\");\n}\nList<String> names = dmnRepositoryService.getDeploymentResourceNames(deploymentId);","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"deploymentId must be a non-empty string\");\n}","typeGuard":"boolean isValidId(String id) { return id != null && !id.trim().isEmpty(); }","tryCatchPattern":"try {\n    names = dmnRepositoryService.getDeploymentResourceNames(deploymentId);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"Missing deploymentId\", e);\n    throw new BadRequestException(\"deploymentId is required\");\n}","preventionTips":["Always resolve ids via repository-service queries rather than storing them manually","Null-check id parameters at service boundaries","Avoid returning raw nulls from earlier lookups that feed this API"],"tags":["java","flowable-dmn","null-check","validation"],"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"}