{"record":{"id":"6f19927cf80d7562","repo":"flowable/flowable-engine","slug":"no-plan-item-instance-found-for-id-6f1992","errorCode":null,"errorMessage":"No plan item instance found for id ","messagePattern":"No plan item instance found for id ","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/RescheduleTimerJobCmd.java","lineNumber":59,"sourceCode":"    protected String newDateValue;\n\n    public RescheduleTimerJobCmd(String eventListenerInstanceId, String jobId, Date newDueDate, String newDateValue) {\n        this.eventListenerInstanceId = eventListenerInstanceId;\n        this.jobId = jobId;\n        this.newDueDate = newDueDate;\n        this.newDateValue = newDateValue;\n    }\n\n    @Override\n    public Job execute(CommandContext commandContext) {\n        String timerJobId = null;\n        PlanItemInstance planItemInstance = null;\n        JobService jobService = CommandContextUtil.getJobService(commandContext);\n        \n        if (eventListenerInstanceId != null) {\n            planItemInstance = CommandContextUtil.getPlanItemInstanceEntityManager(commandContext).findById(eventListenerInstanceId);\n            if (planItemInstance == null) {\n                throw new FlowableObjectNotFoundException(\"No plan item instance found for id \" + eventListenerInstanceId);\n            }\n            \n            List<Job> timerJobs = jobService.createTimerJobQuery().planItemInstanceId(eventListenerInstanceId).list();\n            if (timerJobs == null || timerJobs.isEmpty()) {\n                throw new FlowableException(\"No timer jobs found for plan item instance \" + eventListenerInstanceId);\n            }\n            \n            if (timerJobs.size() > 1) {\n                throw new FlowableException(\"Multiple timer jobs found for plan item instance \" + eventListenerInstanceId);\n            }\n            \n            timerJobId = timerJobs.get(0).getId();\n        \n        } else {\n            timerJobId = jobId;\n        }\n        \n        TimerJobService timerJobService = CommandContextUtil.getTimerJobService(commandContext);","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/RescheduleTimerJobCmd.java#L41-L77","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the id via cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(id)","Ensure you pass the event listener's plan item instance id, not another plan item type's id","Reschedule before case completion, or handle FlowableObjectNotFoundException for finished cases","Check engine/database consistency in multi-environment setups"],"exampleFix":"// before\ncmmnRuntimeService.rescheduleTimerJob(eventListenerInstanceId, null, newDate);\n// after\nif (cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(eventListenerInstanceId).count() == 0) {\n    throw new IllegalStateException(\"Event listener \" + eventListenerInstanceId + \" does not exist\");\n}\ncmmnRuntimeService.rescheduleTimerJob(eventListenerInstanceId, null, newDate);","handlingStrategy":"validation","validationCode":"boolean exists = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(eventListenerInstanceId).count() > 0;","typeGuard":null,"tryCatchPattern":"try { reschedule(...); } catch (FlowableObjectNotFoundException e) { log.warn(\"Event listener {} not found\", eventListenerInstanceId); }","preventionTips":["Only pass event listener plan item ids to reschedule APIs","Reschedule timers before case completion","Confirm the id source and target database match"],"tags":["cmmn","timer-job","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}