{"record":{"id":"a0de9afbd0ad0fef","repo":"flowable/flowable-engine","slug":"could-not-find-reactivation-listener-plan-item-ins","errorCode":null,"errorMessage":"Could not find reactivation listener plan item instance in case {caseInstanceId}","messagePattern":"Could not find reactivation listener plan item instance in case (.+?)","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/agenda/operation/ReactivateCaseInstanceOperation.java","lineNumber":52,"sourceCode":"public class ReactivateCaseInstanceOperation extends AbstractCaseInstanceOperation {\n\n    public ReactivateCaseInstanceOperation(CommandContext commandContext, CaseInstanceEntity caseInstanceEntity) {\n        super(commandContext, null, caseInstanceEntity);\n    }\n\n    @Override\n    public void run() {\n        super.run();\n\n        // PHASE 1:\n        // execute phase 1 of the reactivation: reactivate the listener plan item and all of its depending plan items, then trigger it\n        List<PlanItemInstanceEntity> planItemInstances = caseInstanceEntity.getChildPlanItemInstances();\n\n        // we first search for the reactivation event, set it to available and then actually trigger it\n        ReactivateEventListener reactivateEventListener = CaseDefinitionUtil.getCase(caseInstanceEntity.getCaseDefinitionId()).getReactivateEventListener();\n        PlanItemInstanceEntity reactivationListenerPlanItemInstance = searchPlanItemInstance(reactivateEventListener.getId(), planItemInstances);\n        if (reactivationListenerPlanItemInstance == null) {\n            throw new FlowableIllegalArgumentException(\"Could not find reactivation listener plan item instance in case \" + caseInstanceEntity.getId());\n        }\n\n        // reactivate the listener and direct dependencies of it so they can be triggered later\n        // we don't reuse the existing plan item instance but rather create a new one so we don't lose its history and data\n        PlanItemInstanceEntity reactivationListener = reactivatePlanItem(reactivationListenerPlanItemInstance);\n\n        // all directly depending plan items need to be reactivated as well to be in the correct state before the listener is triggered\n        List<PlanItem> directlyReactivatedPlanItems = reactivateDependingPlanItems(reactivationListener, planItemInstances);\n\n        // now as all depending plan items have been reactivated, trigger the reactivation event listener to start the reactivation of the case\n        CommandContextUtil.getAgenda(commandContext).planTriggerPlanItemInstanceOperation(reactivationListener);\n\n        // PHASE 2:\n        // execute phase 2 of the reactivation: step through all root plan items and reactivate them according the cae model\n        CommandContextUtil.getAgenda(commandContext).planReactivatePlanModelOperation(caseInstanceEntity, directlyReactivatedPlanItems);\n    }\n\n    /**","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/agenda/operation/ReactivateCaseInstanceOperation.java#L34-L70","documentation":"When resuming (reactivating) a suspended case instance, the engine looks up the case model's ReactivateEventListener definition and searches the case's child plan item instances for a matching instance. If no such plan item instance exists, the reactivation cannot proceed and a FlowableIllegalArgumentException is thrown.","triggerScenarios":"Calling CmmnRuntimeService.resumeCaseInstance (or agenda-based reactivation) on a case instance whose plan model never created the reactivation event listener plan item, or whose listener instance has a different definition id.","commonSituations":"Case suspended before the reactivation listener plan item was created; case definition redeployed/changed so the listener id no longer matches persisted instances; wrong case instance id passed to resume.","solutions":["Verify the case definition contains a ReactivateEventListener and that it was instantiated (check ACT_CMMN_RU_PLAN_ITEM_INST) before suspending.","Ensure you resume the correct case instance id.","Redeploy a corrected case model or repair the plan item instance data so the listener definition id matches.","Catch FlowableIllegalArgumentException and surface a clear message that the case lacks a reactivation listener."],"exampleFix":"// before\ncmmnRuntimeService.resumeCaseInstance(caseInstanceId);\n// after\nPlanItemInstanceQuery q = cmmnRuntimeService.createPlanItemInstanceQuery()\n    .caseInstanceId(caseInstanceId)\n    .planItemDefinitionType(\"reactivateEventListener\");\nif (q.count() == 0) {\n    throw new IllegalStateException(\"No reactivation listener on case \" + caseInstanceId);\n}\ncmmnRuntimeService.resumeCaseInstance(caseInstanceId);","handlingStrategy":"validation","validationCode":"// java\nlong n = cmmnRuntimeService.createPlanItemInstanceQuery()\n    .caseInstanceId(caseInstanceId)\n    .planItemDefinitionType(\"reactivateEventListener\").count();\nif (n == 0) throw new IllegalStateException(\"Case has no reactivation listener instance\");","typeGuard":null,"tryCatchPattern":"try {\n    cmmnRuntimeService.resumeCaseInstance(caseInstanceId);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"Could not find reactivation listener\")) {\n        // repair model or data\n    }\n}","preventionTips":["Include a ReactivateEventListener in every case model that supports suspend/resume.","Do not rename plan item ids in deployed case models with running instances.","Verify listener instantiation before suspending a case."],"tags":["cmmn","reactivation","case-instance"],"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-14T05:17:10.506Z"}