{"record":{"id":"416b271920d2b283","repo":"flowable/flowable-engine","slug":"process-definition","errorCode":null,"errorMessage":"Process Definition '","messagePattern":"Process Definition '","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetRenderedStartFormCmd.java","lineNumber":49,"sourceCode":" * @author Joram Barrez\n */\npublic 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 = CommandContextUtil.getProcessEngineConfiguration(commandContext).getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);\n\n        if (processDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Process Definition '\" + processDefinitionId + \"' not found\", ProcessDefinition.class);\n        }\n\n        if (Flowable5Util.isFlowable5ProcessDefinition(processDefinition, commandContext)) {\n            return Flowable5Util.getFlowable5CompatibilityHandler().getRenderedStartForm(processDefinitionId, formEngineName);\n        }\n\n        FormHandlerHelper formHandlerHelper = CommandContextUtil.getProcessEngineConfiguration(commandContext).getFormHandlerHelper();\n        StartFormHandler startFormHandler = formHandlerHelper.getStartFormHandler(commandContext, processDefinition);\n        if (startFormHandler == null) {\n            return null;\n        }\n\n        FormEngine formEngine = CommandContextUtil.getProcessEngineConfiguration(commandContext).getFormEngines().get(formEngineName);\n\n        if (formEngine == null) {\n            throw new FlowableException(\"No formEngine '\" + formEngineName + \"' defined process engine configuration\");\n        }\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetRenderedStartFormCmd.java#L31-L67","documentation":"FlowableObjectNotFoundException thrown by GetRenderedStartFormCmd.execute when the given processDefinitionId does not resolve to a deployed process definition. The deployment manager looks up the definition by id and, finding nothing, reports that the referenced entity does not exist. Message text is truncated in source but reads \"Process Definition '<id>' not found\" with ProcessDefinition.class as the resource type.","triggerScenarios":"Calling RuntimeService.getStartFormRenderedStartForm equivalent: formService.getRenderedStartForm(processDefinitionId, formEngineName) with an id that is not a deployed definition — e.g. a stale id, a definitionId instead of definitionKey, or an id from another engine/database.","commonSituations":"Using the process definition key instead of the id; the definition was deleted by a cascade delete of its deployment; pointing at the wrong database/tenant; ids cached in a UI from before a redeployment that changed definition ids.","solutions":["Verify the id via RepositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult() and fix the caller to pass a valid definition id.","If you only have a key, use processDefinitionQuery().latestVersion().processDefinitionKey(key) to obtain the current id first.","Re-check tenant/database configuration: ensure the engine connects to the DB where the definition is deployed.","Redeploy the process definition if its deployment was deleted."],"exampleFix":"// before\nObject form = formService.getRenderedStartForm(\"myProcess\"); // key, not id\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(\"myProcess\").latestVersion().singleResult();\nObject form = formService.getRenderedStartForm(pd.getId());","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(processDefinitionId).singleResult();\nif (pd == null) throw new IllegalArgumentException(\"Unknown process definition id: \" + processDefinitionId);","typeGuard":null,"tryCatchPattern":"try {\n    return formService.getRenderedStartForm(processDefinitionId);\n} catch (FlowableObjectNotFoundException e) {\n    // definition not deployed; surface a 404-style response\n}","preventionTips":["Always use the definition id (from a definition query), never the key.","Resolve latest-version ids at request time instead of caching them across redeployments.","Confirm engine points at the expected database/tenant."],"tags":["process-definition","not-found","forms","flowable"],"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"}