{"record":{"id":"b59ac3ae620fd7d3","repo":"flowable/flowable-engine","slug":"could-not-find-deployment-with-id-deploymentid-b59ac3","errorCode":null,"errorMessage":"Could not find deployment with id <deploymentId>","messagePattern":"Could not find deployment with id <deploymentId>","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/SetDeploymentParentDeploymentIdCmd.java","lineNumber":49,"sourceCode":"    protected String deploymentId;\n    protected String newParentDeploymentId;\n\n    public SetDeploymentParentDeploymentIdCmd(String deploymentId, String newParentDeploymentId) {\n        this.deploymentId = deploymentId;\n        this.newParentDeploymentId = newParentDeploymentId;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n\n        // Update all entities\n\n        DmnDeploymentEntity deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId);\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find deployment with id \" + deploymentId);\n        }\n\n        deployment.setParentDeploymentId(newParentDeploymentId);\n\n        CommandContextUtil.getDeploymentEntityManager(commandContext).update(deployment);\n\n        return null;\n\n    }\n\n}\n","sourceCodeStart":31,"sourceCodeEnd":61,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/SetDeploymentParentDeploymentIdCmd.java#L31-L61","documentation":"SetDeploymentParentDeploymentIdCmd.execute looks up a DMN deployment by id via the deployment entity manager; if no deployment row matches the given id it throws FlowableObjectNotFoundException. This guards the parent-deployment reassignment command against operating on a nonexistent or already-deleted deployment.","triggerScenarios":"Calling SetDeploymentParentDeploymentIdCmd (or the management-service API that wraps it) with a deploymentId string that has no matching row in ACT_DMN_DEPLOYMENT, e.g. an id from a different engine's deployment table or one removed by a delete-deployment call.","commonSituations":"Passing a process/case-engine deployment id instead of a DMN deployment id; deployment was deleted in another node/transaction; id typo or stale id cached from a previous run; querying the wrong DMN engine's database schema.","solutions":["Verify the deploymentId exists first via DmnRepositoryService.createDeploymentQuery().deploymentId(id).singleResult() before reassigning the parent.","Confirm you are using a DMN deployment id (from DmnRepositoryService.deploy()), not a process-engine deployment id.","Check the dmn engine is pointed at the same database/schema where the deployment was created.","Catch FlowableObjectNotFoundException and treat it as a not-found condition rather than retrying."],"exampleFix":"// before\nmanagementService.executeCommand(new SetDeploymentParentDeploymentIdCmd(deploymentId, parentId));\n// after\nif (dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).count() == 0) {\n    throw new IllegalStateException(\"DMN deployment \" + deploymentId + \" does not exist\");\n}\nmanagementService.executeCommand(new SetDeploymentParentDeploymentIdCmd(deploymentId, parentId));","handlingStrategy":"validation","validationCode":"if (deploymentId == null || dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).count() == 0) {\n    throw new IllegalArgumentException(\"DMN deployment not found: \" + deploymentId);\n}","typeGuard":null,"tryCatchPattern":"try {\n    dmnManagementService.executeCommand(new SetDeploymentParentDeploymentIdCmd(deploymentId, parentId));\n} catch (FlowableObjectNotFoundException e) {\n    log.warn(\"DMN deployment {} not found\", deploymentId);\n}","preventionTips":["Always obtain deployment ids from DmnRepositoryService deployment queries, not from other engines","Check deployment existence before mutation commands","Watch for concurrent delete-deployment operations"],"tags":["flowable","dmn","deployment","not-found"],"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"}