flowable/flowable-engine · error · FlowableObjectNotFoundException

No plan item instance found for id

Error message

No plan item instance found for id 

What it means

RescheduleTimerJobCmd reschedules the timer job attached to a CMMN plan item (event listener) instance. When an eventListenerInstanceId is provided it loads the plan item instance first and throws FlowableObjectNotFoundException if none exists with that id.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/RescheduleTimerJobCmd.java:59

    protected String newDateValue;

    public RescheduleTimerJobCmd(String eventListenerInstanceId, String jobId, Date newDueDate, String newDateValue) {
        this.eventListenerInstanceId = eventListenerInstanceId;
        this.jobId = jobId;
        this.newDueDate = newDueDate;
        this.newDateValue = newDateValue;
    }

    @Override
    public Job execute(CommandContext commandContext) {
        String timerJobId = null;
        PlanItemInstance planItemInstance = null;
        JobService jobService = CommandContextUtil.getJobService(commandContext);
        
        if (eventListenerInstanceId != null) {
            planItemInstance = CommandContextUtil.getPlanItemInstanceEntityManager(commandContext).findById(eventListenerInstanceId);
            if (planItemInstance == null) {
                throw new FlowableObjectNotFoundException("No plan item instance found for id " + eventListenerInstanceId);
            }
            
            List<Job> timerJobs = jobService.createTimerJobQuery().planItemInstanceId(eventListenerInstanceId).list();
            if (timerJobs == null || timerJobs.isEmpty()) {
                throw new FlowableException("No timer jobs found for plan item instance " + eventListenerInstanceId);
            }
            
            if (timerJobs.size() > 1) {
                throw new FlowableException("Multiple timer jobs found for plan item instance " + eventListenerInstanceId);
            }
            
            timerJobId = timerJobs.get(0).getId();
        
        } else {
            timerJobId = jobId;
        }
        
        TimerJobService timerJobService = CommandContextUtil.getTimerJobService(commandContext);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the id via cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(id)
  2. Ensure you pass the event listener's plan item instance id, not another plan item type's id
  3. Reschedule before case completion, or handle FlowableObjectNotFoundException for finished cases
  4. Check engine/database consistency in multi-environment setups

Example fix

// before
cmmnRuntimeService.rescheduleTimerJob(eventListenerInstanceId, null, newDate);
// after
if (cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(eventListenerInstanceId).count() == 0) {
    throw new IllegalStateException("Event listener " + eventListenerInstanceId + " does not exist");
}
cmmnRuntimeService.rescheduleTimerJob(eventListenerInstanceId, null, newDate);
Defensive patterns

Strategy: validation

Validate before calling

boolean exists = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(eventListenerInstanceId).count() > 0;

Try / catch

try { reschedule(...); } catch (FlowableObjectNotFoundException e) { log.warn("Event listener {} not found", eventListenerInstanceId); }

Prevention

When it happens

Trigger: Calling the reschedule API with an eventListenerInstanceId that is unknown, was deleted with its case, or belongs to another database; also when a non-listener plan item id is passed by mistake.

Common situations: Rescheduling after the case finished and entities were historized; using a human task plan item id where an event listener id is expected; config/test data referencing purged instances.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/6f19927cf80d7562. Report an issue: GitHub.