{"record":{"id":"80206f31a0d3423c","repo":"flowable/flowable-engine","slug":"no-deployment-found-for-id-deploymentid-80206f","errorCode":null,"errorMessage":"No deployment found for id = '${deploymentId}'","messagePattern":"No deployment found for id = '(.+?)'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/SetDeploymentCategoryCmd.java","lineNumber":45,"sourceCode":"    protected String deploymentId;\n    protected String category;\n\n    public SetDeploymentCategoryCmd(String deploymentId, String category) {\n        this.deploymentId = deploymentId;\n        this.category = category;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"Deployment id is null\");\n        }\n\n        EventDeploymentEntity deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId);\n\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"No deployment found for id = '\" + deploymentId + \"'\");\n        }\n\n        // Update category\n        deployment.setCategory(category);\n        CommandContextUtil.getDeploymentEntityManager(commandContext).update(deployment);\n\n        return null;\n    }\n\n    public String getDeploymentId() {\n        return deploymentId;\n    }\n\n    public void setDeploymentId(String deploymentId) {\n        this.deploymentId = deploymentId;\n    }\n\n    public String getCategory() {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/SetDeploymentCategoryCmd.java#L27-L63","documentation":"Lookup failure in SetDeploymentCategoryCmd.execute: deploymentId passed the null check, but no event deployment entity exists with that id, so there is nothing to attach the category to.","triggerScenarios":"Calling setDeploymentCategory with an id of a deployment that was deleted, never existed in this database, or belongs to another engine (process vs event registry).","commonSituations":"Passing a BPMN process deployment id to the event registry API; ids from a re-initialized database; deployments purged by cleanup jobs between obtaining the id and using it.","solutions":["Look up the deployment via eventRepositoryService.createDeploymentQuery() to get a current, valid id.","Confirm the id belongs to an event registry deployment, not a process/form/other engine deployment.","Redeploy the event definition archive if the deployment was removed.","Check database connectivity points at the environment where the deployment exists."],"exampleFix":"// before\neventRepositoryService.setDeploymentCategory(\"bpmn-deploy-9\", \"events\"); // wrong engine's deployment id\n// after\nEventDeployment dep = eventRepositoryService.createDeploymentQuery().deploymentName(\"myEvents\").singleResult();\neventRepositoryService.setDeploymentCategory(dep.getId(), \"events\");","handlingStrategy":"try-catch","validationCode":"EventDeployment dep = eventRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (dep == null) throw new IllegalStateException(\"No event deployment with id \" + deploymentId);","typeGuard":"boolean deploymentExists(String id) {\n    return eventRepositoryService.createDeploymentQuery().deploymentId(id).count() > 0;\n}","tryCatchPattern":"try {\n    eventRepositoryService.setDeploymentCategory(id, category);\n} catch (FlowableObjectNotFoundException e) {\n    log.warn(\"Event deployment {} not found; verify engine and environment\", id, e);\n}","preventionTips":["Keep engine-specific ids with their engines; never share ids across Flowable engines.","Re-resolve deployment ids after DB re-initialization or cleanup.","Use deployment names/keys to fetch current ids at runtime."],"tags":["flowable","event-registry","not-found","deployment"],"backgroundTag":"entity-not-found","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"}