flowable/flowable-engine · error · FlowableObjectNotFoundException
Form model for process definition
Error message
Form model for process definition
What it means
After resolving the process definition and its BPMN model, GetStartFormModelCmd looks up the form definition referenced by the start event; if formInfo remains null it throws FlowableObjectNotFoundException('Form model for process definition ... cannot be found'). The comment in the source makes the intent explicit: the start event declares a form that does not exist (or is not visible), and the engine refuses to leak that absence to arbitrary callers.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetStartFormModelCmd.java:73
throw new FlowableIllegalArgumentException("Form engine is not initialized");
}
FormInfo formInfo = null;
ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionId);
BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(processDefinitionId);
Process process = bpmnModel.getProcessById(processDefinition.getKey());
FlowElement startElement = process.getInitialFlowElement();
if (startElement instanceof StartEvent startEvent) {
if (StringUtils.isNotEmpty(startEvent.getFormKey())) {
Deployment deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(processDefinition.getDeploymentId());
formInfo = formService.getFormInstanceModelByKeyAndParentDeploymentId(startEvent.getFormKey(), deployment.getParentDeploymentId(),
null, processInstanceId, null, processDefinition.getTenantId(), processEngineConfiguration.isFallbackToDefaultTenant());
}
}
// If form does not exists, we don't want to leak out this info to just anyone
if (formInfo == null) {
throw new FlowableObjectNotFoundException("Form model for process definition " + processDefinitionId + " cannot be found");
}
FormFieldHandler formFieldHandler = processEngineConfiguration.getFormFieldHandler();
formFieldHandler.enrichFormFields(formInfo);
return formInfo;
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Deploy the form definitions (FormRepositoryService or the .form resources in the app deployment) so formKey resolves
- Verify the formKey on the start event matches a deployed form info id/key and correct typos
- In multi-tenant setups enable processEngineConfiguration.setFallbackToDefaultTenant(true) or deploy the form for the definition's tenant
- Query formRepositoryService.createFormInfoQuery() (or form definition query) directly first to confirm the form exists for that tenant before calling the API
Example fix
// before
formService.getStartFormModel(processDefinitionId, null); // throws if form not deployed
// after
FormInfo info = formRepositoryService.createFormDefinitionQuery()
.formDefinitionKey("myStartForm").tenantId(tenantId).latestVersion().singleResult();
if (info != null) {
formService.getStartFormModel(processDefinitionId, null);
} Defensive patterns
Strategy: validation
Validate before calling
FormDefinition formDef = formRepositoryService.createFormDefinitionQuery()
.latestVersion()
.formDefinitionKey(startEventFormKey)
.tenantId(tenantId)
.singleResult();
if (formDef == null) throw new IllegalStateException("Form " + startEventFormKey + " not deployed for tenant " + tenantId); Type guard
boolean startFormDeployed(FormRepositoryService frs, String formKey, String tenantId) {
return formKey != null && frs.createFormDefinitionQuery()
.formDefinitionKey(formKey)
.tenantId(tenantId)
.latestVersion()
.count() > 0;
} Try / catch
try {
return formService.getStartFormModel(pdId, null);
} catch (FlowableObjectNotFoundException e) {
log.warn("Start form for {} not found (tenant deployment or formKey typo)", pdId);
return null;
} Prevention
- Deploy .form resources together with the process application deployment
- Verify start-event formKey values match deployed form keys exactly (case-sensitive)
- In multi-tenant installations, deploy forms per tenant or enable fallbackToDefaultTenant
- Only query start forms after the deployment transaction has committed
When it happens
Trigger: getStartFormModel on a definition whose start event references a formKey/form definition that is not deployed in the form repository, or deployed under a different tenantId without fallback-to-default-tenant enabled.
Common situations: Deploying the process model without deploying the accompanying .form files; form definitions deployed to another tenant; form reference typo in flowable:formKey; querying before the form deployment transaction committed; multi-tenant setup where isFallbackToDefaultTenant is false and the tenant's form is missing.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Could not find a resource with id '<resourceName>' in deploy
- Could not find an app deployment with id '<deploymentId>
- Could not find an app deployment with id '<deploymentId>
- Could not find a resource with name '<resourceName>' in depl
- Could not find a deployment with id '<deploymentId>'.
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/f88ee6b7a37cc837.
Report an issue: GitHub.