{"record":{"id":"dacea5ab14db6334","repo":"flowable/flowable-engine","slug":"process-definition-not-found","errorCode":null,"errorMessage":"Process Definition '' not found","messagePattern":"Process Definition '' not found","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/GetRenderedStartFormCmd.java","lineNumber":49,"sourceCode":"public class GetRenderedStartFormCmd implements Command<Object>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String processDefinitionId;\n    protected String formEngineName;\n\n    public GetRenderedStartFormCmd(String processDefinitionId, String formEngineName) {\n        this.processDefinitionId = processDefinitionId;\n        this.formEngineName = formEngineName;\n    }\n\n    @Override\n    public Object execute(CommandContext commandContext) {\n        ProcessDefinition processDefinition = commandContext\n                .getProcessEngineConfiguration()\n                .getDeploymentManager()\n                .findDeployedProcessDefinitionById(processDefinitionId);\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\"Process Definition '\" + processDefinitionId + \"' not found\", ProcessDefinition.class);\n        }\n        StartFormHandler startFormHandler = ((ProcessDefinitionEntity) processDefinition).getStartFormHandler();\n        if (startFormHandler == null) {\n            return null;\n        }\n\n        FormEngine formEngine = commandContext\n                .getProcessEngineConfiguration()\n                .getFormEngines()\n                .get(formEngineName);\n\n        if (formEngine == null) {\n            throw new ActivitiException(\"No formEngine '\" + formEngineName + \"' defined process engine configuration\");\n        }\n\n        StartFormData startForm = startFormHandler.createStartFormData(processDefinition);\n\n        return formEngine.renderStartForm(startForm);","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/GetRenderedStartFormCmd.java#L31-L67","documentation":"Thrown by GetRenderedStartFormCmd when findDeployedProcessDefinitionById cannot resolve the given processDefinitionId to a deployed process definition. The library throws ActivitiObjectNotFoundException because rendering a start form is meaningless without a deployed definition.","triggerScenarios":"Calling FormService.getRenderedStartForm(processDefinitionId) (directly or via the command) with an id that does not match any deployment, or with a definition that has been deleted from the ACT_RE_PROCDEF table.","commonSituations":"Typo or stale processDefinitionId cached from a previous deployment; calling before the process was deployed to this engine (wrong database/schema); definition deleted by cascading deleteDeployment; pointing at another engine's repository.","solutions":["Verify the processDefinitionId exists: query RepositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult() and confirm it is non-null.","Re-check that the process definition was actually deployed on the engine instance you are calling (correct database, correct schema prefix).","Re-deploy the BPMN with RepositoryService.createDeployment() if the deployment was deleted, and use the id from the new deployment.","If using latest-version lookups, prefer processDefinitionKey plus latestVersion() instead of a hardcoded version-specific id."],"exampleFix":"// before\nformService.getRenderedStartForm(\"orderProcess:1:999\"); // stale id\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(\"orderProcess\").latestVersion().singleResult();\nif (pd != null) {\n    formService.getRenderedStartForm(pd.getId());\n}","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(processDefinitionId).singleResult();\nif (pd == null) throw new IllegalArgumentException(\"Unknown process definition: \" + processDefinitionId);","typeGuard":null,"tryCatchPattern":"try {\n    formService.getRenderedStartForm(processDefinitionId);\n} catch (ActivitiObjectNotFoundException e) {\n    if (ProcessDefinition.class.equals(e.getObjectClass())) {\n        // refresh definition id from repository\n    }\n}","preventionTips":["Always resolve definition ids via ProcessDefinitionQuery rather than caching them across deploys","Deploy and verify in the same engine instance you call forms on","Watch for deleteDeployment cascades that remove definitions still referenced by clients"],"tags":["process-definition","not-found","workflow","form-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-14T11:17:12.474Z"}