flowable/flowable-engine · error · FlowableException
Deleting a single process definition is not supported
Error message
Deleting a single process definition is not supported
What it means
Flowable does not support deleting a process definition entity individually. Process definitions are only removed as part of deleting their whole deployment (via RepositoryService.deleteDeployment), because the deployment owns the definition and its resources. Calling the entity manager's delete for a single ProcessDefinitionEntity deliberately throws this exception.
Solutions
- Use RepositoryService.deleteDeployment(deploymentId) (optionally with cascade=true) to delete definitions together with their deployment.
- If only certain versions should be hidden, migrate running instances and use setProcessDefinitionCategory or tenant isolation instead of deleting.
- Avoid calling internal *EntityManagerImpl APIs; operate through RepositoryService commands.
Example fix
// before processEngineConfiguration.getCommandExecutor().execute(... processDefinitionEntityManager.delete(def, false) ...); // after repositoryService.deleteDeployment(deploymentId, true); // cascades definitions, resources, instances
Defensive patterns
Strategy: fallback
Prevention
- Only delete definitions via RepositoryService.deleteDeployment
- Avoid internal *EntityManagerImpl APIs in custom code
- Hide obsolete versions via category/tenant strategy instead of deleting
When it happens
Trigger: Invoking ProcessDefinitionEntityManager.delete(entity, fireDeleteEvent) directly, e.g. from custom persistence/command code, or indirectly through an API that cascades deletes to a definition without deleting the deployment.
Common situations: Custom admin code trying to purge one deployed process version; writing a custom command that removes a definition while leaving its deployment; mistaken use of internal entity manager APIs instead of RepositoryService.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Cannot find process definition with id
- No process definition found for id =
- Cannot find process definition for id
- Cannot find process definition for id
- Cannot find process definition for id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/7fdc52d2caeabeab.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/entity/ProcessDefinitionEntityManagerImpl.java:44
/**
* @author Tom Baeyens
* @author Falko Menge
* @author Saeid Mirzaei
* @author Joram Barrez
*/
public class ProcessDefinitionEntityManagerImpl
extends AbstractProcessEngineEntityManager<ProcessDefinitionEntity, ProcessDefinitionDataManager>
implements ProcessDefinitionEntityManager {
public ProcessDefinitionEntityManagerImpl(ProcessEngineConfigurationImpl processEngineConfiguration, ProcessDefinitionDataManager processDefinitionDataManager) {
super(processEngineConfiguration, processDefinitionDataManager);
}
@Override
public void delete(ProcessDefinitionEntity entity, boolean fireDeleteEvent) {
// There is no delete statement for deleting a single ProcessDefinition
// process definitions are deleted as part of a deployment
throw new FlowableException("Deleting a single process definition is not supported");
}
@Override
public ProcessDefinitionEntity findLatestProcessDefinitionByKey(String processDefinitionKey) {
return dataManager.findLatestProcessDefinitionByKey(processDefinitionKey);
}
@Override
public ProcessDefinitionEntity findLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) {
return dataManager.findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);
}
@Override
public ProcessDefinitionEntity findLatestDerivedProcessDefinitionByKey(String processDefinitionKey) {
return dataManager.findLatestDerivedProcessDefinitionByKey(processDefinitionKey);
}
@OverrideView on GitHub (pinned to d6d39ce1c6)