flowable/flowable-engine · error · ActivitiObjectNotFoundException
Process Definition '' not found
Error message
Process Definition '' not found
What it means
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.
Source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/GetRenderedStartFormCmd.java:49
public class GetRenderedStartFormCmd implements Command<Object>, Serializable {
private static final long serialVersionUID = 1L;
protected String processDefinitionId;
protected String formEngineName;
public GetRenderedStartFormCmd(String processDefinitionId, String formEngineName) {
this.processDefinitionId = processDefinitionId;
this.formEngineName = formEngineName;
}
@Override
public Object execute(CommandContext commandContext) {
ProcessDefinition processDefinition = commandContext
.getProcessEngineConfiguration()
.getDeploymentManager()
.findDeployedProcessDefinitionById(processDefinitionId);
if (processDefinition == null) {
throw new ActivitiObjectNotFoundException("Process Definition '" + processDefinitionId + "' not found", ProcessDefinition.class);
}
StartFormHandler startFormHandler = ((ProcessDefinitionEntity) processDefinition).getStartFormHandler();
if (startFormHandler == null) {
return null;
}
FormEngine formEngine = commandContext
.getProcessEngineConfiguration()
.getFormEngines()
.get(formEngineName);
if (formEngine == null) {
throw new ActivitiException("No formEngine '" + formEngineName + "' defined process engine configuration");
}
StartFormData startForm = startFormHandler.createStartFormData(processDefinition);
return formEngine.renderStartForm(startForm);View on GitHub (pinned to d6d39ce1c6)
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.
Example fix
// before
formService.getRenderedStartForm("orderProcess:1:999"); // stale id
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey("orderProcess").latestVersion().singleResult();
if (pd != null) {
formService.getRenderedStartForm(pd.getId());
} Defensive patterns
Strategy: validation
Validate before calling
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(processDefinitionId).singleResult();
if (pd == null) throw new IllegalArgumentException("Unknown process definition: " + processDefinitionId); Try / catch
try {
formService.getRenderedStartForm(processDefinitionId);
} catch (ActivitiObjectNotFoundException e) {
if (ProcessDefinition.class.equals(e.getObjectClass())) {
// refresh definition id from repository
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
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
- Cannot find process definition for key '${processDefinitionK
- Task '' not found
- No process definition found for id ''
- No process definition found for id '<processDefinitionId>'
- No process definition found for id = '<processDefinitionId>'
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/dacea5ab14db6334.
Report an issue: GitHub.