{"record":{"id":"3d00b934e57eccb2","repo":"flowable/flowable-engine","slug":"no-process-definition-found-for-id-processd","errorCode":null,"errorMessage":"No process definition found for id = '\" + processDefinitionId + \"'","messagePattern":"No process definition found for id = '\" \\+ processDefinitionId \\+ \"'","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetProcessDefinitionCategoryCmd.java","lineNumber":52,"sourceCode":"\n    public SetProcessDefinitionCategoryCmd(String processDefinitionId, String category) {\n        this.processDefinitionId = processDefinitionId;\n        this.category = category;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n\n        if (processDefinitionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Process definition id is null\");\n        }\n\n        ProcessDefinitionEntity processDefinition = commandContext\n                .getProcessDefinitionEntityManager()\n                .findProcessDefinitionById(processDefinitionId);\n\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\"No process definition found for id = '\" + processDefinitionId + \"'\", ProcessDefinition.class);\n        }\n\n        // Update category\n        processDefinition.setCategory(category);\n\n        // Remove process definition from cache, it will be refetched later\n        DeploymentCache<ProcessDefinitionCacheEntry> processDefinitionCache = commandContext.getProcessEngineConfiguration().getProcessDefinitionCache();\n        if (processDefinitionCache != null) {\n            processDefinitionCache.remove(processDefinitionId);\n        }\n\n        if (commandContext.getEventDispatcher().isEnabled()) {\n            commandContext.getEventDispatcher().dispatchEvent(\n                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, processDefinition),\n                    EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);\n        }\n\n        return null;","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetProcessDefinitionCategoryCmd.java#L34-L70","documentation":"SetProcessDefinitionCategoryCmd looks up the definition via ProcessDefinitionEntityManager.findProcessDefinitionById; when no definition matches the id it throws ActivitiObjectNotFoundException carrying the id and ProcessDefinition.class.","triggerScenarios":"RepositoryService.setProcessDefinitionCategory(processDefinitionId, category) with an id absent from ACT_RE_PROCDEF — typo, wrong database, or the definition was redeployed with a new id/version.","commonSituations":"Hard-coded definition ids that changed between deployments, cross-environment id reuse, schema cleaned by deletion jobs, multi-tenant/engine mismatch.","solutions":["Resolve the current id via RepositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult().","Verify the engine points at the database containing the definition.","Re-deploy the process definition if it was removed and use the fresh id."],"exampleFix":"// before\nrepositoryService.setProcessDefinitionCategory(processDefinitionId, \"billing\");\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n        .processDefinitionId(processDefinitionId).singleResult();\nif (pd != null) {\n    repositoryService.setProcessDefinitionCategory(processDefinitionId, \"billing\");\n}","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(pdId).singleResult();\nif (pd == null) throw new IllegalArgumentException(\"No process definition \" + pdId);","typeGuard":null,"tryCatchPattern":"try { repositoryService.setProcessDefinitionCategory(pdId, category); }\ncatch (ActivitiObjectNotFoundException e) { log.warn(\"definition {} not found\", pdId); }","preventionTips":["Look up latest version by key instead of hard-coding definition ids","Re-resolve ids after every redeploy","Check environment/database alignment"],"tags":["process-definition","not-found","repository-service"],"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-18T11:17:12.947Z"}