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

  1. Use RepositoryService.deleteDeployment(deploymentId) (optionally with cascade=true) to delete definitions together with their deployment.
  2. If only certain versions should be hidden, migrate running instances and use setProcessDefinitionCategory or tenant isolation instead of deleting.
  3. 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

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


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);
    }

    @Override

View on GitHub (pinned to d6d39ce1c6)