{"record":{"id":"11fbb8fdeba397dc","repo":"flowable/flowable-engine","slug":"deploymentid-is-null-11fbb8","errorCode":null,"errorMessage":"deploymentId is null","messagePattern":"deploymentId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDeploymentResourceNamesCmd.java","lineNumber":38,"sourceCode":"import org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.engine.impl.util.CommandContextUtil;\n\n/**\n * @author Joram Barrez\n */\npublic class GetDeploymentResourceNamesCmd implements Command<List>, 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 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-engine/src/main/java/org/flowable/engine/impl/cmd/GetDeploymentResourceNamesCmd.java#L20-L45","documentation":"FlowableIllegalArgumentException thrown by GetDeploymentResourceNamesCmd.execute when deploymentId is null. The command lists all resource names belonging to a deployment and cannot proceed without an id. Validation happens before the entity manager query.","triggerScenarios":"Calling repositoryService.getDeploymentResourceNames(null) — typically after a lookup that returned no deployment (null id propagated), or a deserialized request missing the id field.","commonSituations":"REST layer passing an absent path parameter as null; chaining after a failed createDeploymentQuery().singleResult(); importing ids from CSV/JSON where the column is empty.","solutions":["Null-check the id before calling; throw your own descriptive validation error.","Resolve a real deploymentId via createDeploymentQuery() filtered by key/name/latest.","Catch FlowableIllegalArgumentException and map to a 400-style input error.","Fix upstream data so the id field is always populated where the API is invoked."],"exampleFix":"// before\nList<String> names = repositoryService.getDeploymentResourceNames(dep.getId());\n// after\nif (deploymentId == null) throw new IllegalArgumentException(\"deploymentId required\");\nList<String> names = repositoryService.getDeploymentResourceNames(deploymentId);","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.isBlank())\n    throw new IllegalArgumentException(\"deploymentId is required\");\nboolean exists = repositoryService.createDeploymentQuery()\n    .deploymentId(deploymentId).count() > 0;","typeGuard":"Optional<String> nonBlank(String s) {\n    return Optional.ofNullable(s).map(String::trim).filter(t -> !t.isEmpty());\n}","tryCatchPattern":"try {\n    return repositoryService.getDeploymentResourceNames(deploymentId);\n} catch (FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"deploymentId is required\", e);\n}","preventionTips":["Validate deployment ids before every deployment-scoped call.","Check query results for null before propagating ids onward.","Enforce non-blank ids with bean validation on request objects.","Write tests exercising null/empty id arguments on deployment helpers."],"tags":["flowable","validation","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-14T05:17:10.506Z"}