Activiti/Activiti · error · ActivitiObjectNotFoundException

No process definition found for id '

Error message

No process definition found for id '

What it means

SignalEventHandler looks up a process definition when a signal is delivered to a signal start event. If ProcessDefinitionUtil.getProcessDefinition returns null for the stored processDefinitionId, an ActivitiObjectNotFoundException with ProcessDefinition.class as the object type is thrown.

Solutions

  1. Check RepositoryService.createProcessDefinitionQuery().processDefinitionId(id) returns a result; redeploy the missing BPMN if not.
  2. Avoid cascade-deleting deployments with registered signal start events, or re-signal only to active definitions.
  3. Clean stale rows in ACT_RU_EVENT_SUBSCRipt for the deleted definition.
  4. Use latest process definition keys rather than pinned ids if definitions are frequently redeployed.
Defensive patterns

Strategy: validation

Validate before calling

if (repositoryService.createProcessDefinitionQuery().processDefinitionId(defId).singleResult() == null) { redeploy(); }

Try / catch

try { runtimeService.signal(subId); } catch (ActivitiObjectNotFoundException e) { log.warn("definition gone, ignoring signal", e); }

Prevention

When it happens

Trigger: A signal event subscription references a processDefinitionId that no longer exists in the repository when the signal is dispatched.

Common situations: Deployment removed (cascade delete) while signal start subscriptions were registered; environment where the DB was copied/cleaned but runtime subscriptions remained; process definition deleted manually via management APIs.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Activiti/Activiti@56435b1a97 (2026-09-09). Data as JSON: /api/errors/525ad4016ae30398. Report an issue: GitHub.

Appendix: source

Thrown at activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/event/SignalEventHandler.java:63

    @SuppressWarnings("unchecked")
    @Override
    public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {
        if (eventSubscription.getExecutionId() != null) {
            dispatchActivitySignalledEvent(
                eventSubscription.getExecution(),
                eventSubscription.getEventName(),
                payload,
                commandContext
            );

            super.handleEvent(eventSubscription, payload, commandContext);
        } else if (eventSubscription.getProcessDefinitionId() != null) {
            // Find initial flow element matching the signal start event
            String processDefinitionId = eventSubscription.getProcessDefinitionId();
            ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionId);

            if (processDefinition == null) {
                throw new ActivitiObjectNotFoundException(
                    "No process definition found for id '" + processDefinitionId + "'",
                    ProcessDefinition.class
                );
            }

            if (processDefinition.isSuspended()) {
                throw new ActivitiException(
                    "Could not handle signal: process definition with id: " + processDefinitionId + " is suspended"
                );
            }

            org.activiti.bpmn.model.Process process = ProcessDefinitionUtil.getProcess(processDefinitionId);
            FlowElement flowElement = process.getFlowElement(eventSubscription.getActivityId(), true);
            if (flowElement == null) {
                throw new ActivitiException(
                    "Could not find matching FlowElement for activityId " + eventSubscription.getActivityId()
                );
            }

View on GitHub (pinned to 56435b1a97)