{"record":{"id":"fa2594531805d28d","repo":"flowable/flowable-engine","slug":"no-process-definition-found-for-id-fa2594","errorCode":null,"errorMessage":"No process definition found for id ''","messagePattern":"No process definition found for id ''","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/GetStartFormCmd.java","lineNumber":46,"sourceCode":" * @author Tom Baeyens\n */\npublic class GetStartFormCmd implements Command<StartFormData>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String processDefinitionId;\n\n    public GetStartFormCmd(String processDefinitionId) {\n        this.processDefinitionId = processDefinitionId;\n    }\n\n    @Override\n    public StartFormData execute(CommandContext commandContext) {\n        ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) commandContext\n                .getProcessEngineConfiguration()\n                .getDeploymentManager()\n                .findDeployedProcessDefinitionById(processDefinitionId);\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\"No process definition found for id '\" + processDefinitionId + \"'\", ProcessDefinition.class);\n        }\n\n        StartFormHandler startFormHandler = processDefinition.getStartFormHandler();\n        if (startFormHandler == null) {\n            throw new ActivitiException(\"No startFormHandler defined in process '\" + processDefinitionId + \"'\");\n        }\n\n        return startFormHandler.createStartFormData(processDefinition);\n    }\n}\n","sourceCodeStart":28,"sourceCodeEnd":57,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/GetStartFormCmd.java#L28-L57","documentation":"Thrown by GetStartFormCmd as ActivitiObjectNotFoundException when the deployment manager cannot find a deployed process definition for the given processDefinitionId while fetching StartFormData. Unlike 4550 (rendered form) this is the plain start-form retrieval path.","triggerScenarios":"Calling FormService.getStartForm(processDefinitionId) with an id not present in the repository (never deployed, deleted deployment, wrong engine/database, or malformed id).","commonSituations":"Cached/stale ids after redeploy; id copied from a different environment; definition removed by deleteDeployment; unit test running against an in-memory engine while ids came from a persistent one.","solutions":["Validate the id with repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult().","Re-deploy the BPMN and use the fresh definition id if the deployment was deleted.","Ensure the FormService call goes to the same engine instance/database that holds the deployment.","Resolve the id dynamically via processDefinitionKey + latestVersion rather than hardcoding."],"exampleFix":"// before\nformService.getStartForm(\"invoice:3:1234\"); // deleted deployment\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(\"invoice\").latestVersion().singleResult();\nformService.getStartForm(pd.getId());","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.getStartForm(processDefinitionId);\n} catch (ActivitiObjectNotFoundException e) {\n    // look up latest version by key\n}","preventionTips":["Resolve ids dynamically with processDefinitionKey + latestVersion()","Verify deployments exist in the target environment before form calls","Handle deployment deletion cascades in lifecycle tooling"],"tags":["process-definition","not-found","start-form","workflow"],"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"}