{"record":{"id":"ac458545812f8ba8","repo":"flowable/flowable-engine","slug":"planiteminstanceentity-does-not-have-a-behavior","errorCode":null,"errorMessage":"{planItemInstanceEntity} does not have a behavior","messagePattern":"(.+?) does not have a behavior","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/agenda/operation/StartPlanItemInstanceOperation.java","lineNumber":91,"sourceCode":"        CommandContextUtil.getCmmnHistoryManager(commandContext).recordPlanItemInstanceStarted(planItemInstanceEntity);\n    }\n\n    protected void executeActivityBehavior() {\n        CmmnActivityBehavior activityBehavior = (CmmnActivityBehavior) planItemInstanceEntity.getPlanItem().getBehavior();\n        if (migrationContext != null && activityBehavior instanceof CmmnActivityWithMigrationContextBehavior) {\n            ((CmmnActivityWithMigrationContextBehavior) activityBehavior).execute(commandContext, planItemInstanceEntity, migrationContext);\n            \n        } else if (activityBehavior instanceof ChildTaskActivityBehavior) {\n            ((ChildTaskActivityBehavior) activityBehavior).execute(commandContext, planItemInstanceEntity, childTaskVariableInfo);\n            \n        } else if (activityBehavior instanceof CoreCmmnActivityBehavior) {\n            ((CoreCmmnActivityBehavior) activityBehavior).execute(commandContext, planItemInstanceEntity);\n            \n        } else if (activityBehavior != null) {\n            activityBehavior.execute(planItemInstanceEntity);\n\n        } else {\n            throw new FlowableException(planItemInstanceEntity + \" does not have a behavior\");\n\n        }\n    }\n\n    @Override\n    public String getOperationName() {\n        return \"[Start plan item]\";\n    }\n    \n}\n","sourceCodeStart":73,"sourceCodeEnd":102,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/agenda/operation/StartPlanItemInstanceOperation.java#L73-L102","documentation":"StartPlanItemInstanceOperation.executeActivityBehavior resolves a CmmnActivityBehavior for the plan item and executes it. If no behavior class is configured (or it cannot be instantiated to a CoreCmmnActivityBehavior/behavior at all), the engine has nothing to run and throws a FlowableException stating the plan item instance has no behavior.","triggerScenarios":"A plan item definition (e.g. HumanTask, ServiceTask, custom PlanItemDefinition) whose behaviorClass is not set or resolves to null in the CmmnEngineConfiguration / case definition when the agenda starts the plan item.","commonSituations":"Custom plan item definition types without a registered PlanItemBehaviorFactory mapping; engine configuration missing a custom behavior class on the classpath; typo in behaviorClass attribute.","solutions":["Register a behavior for the plan item definition type (PlanItemBehaviorFactory / CmmnEngineConfiguration behavior mapping).","Verify the custom behavior class name and that it is on the engine's classpath.","Use a supported standard plan item definition type (humanTask, serviceTask, eventListener, ...) instead of an unmapped custom type.","Check CmmnEngineConfiguration bean overrides did not wipe default behavior factories."],"exampleFix":"// before: custom definition type with no behavior\ncmmnEngineConfiguration.setPlanItemBehaviorFactory(null);\n// after\nDefaultPlanItemBehaviorFactory factory = new DefaultPlanItemBehaviorFactory();\nfactory.addPlanItemDefinitionBehavior(\"myCustomTask\", MyCustomTaskBehavior.class);\ncmmnEngineConfiguration.setPlanItemBehaviorFactory(factory);","handlingStrategy":"validation","validationCode":"// java: verify behavior configured for the definition type\nCmmnEngineConfiguration cfg = (CmmnEngineConfiguration)\n    cmmnEngine.getCmmnEngineConfiguration();\nif (cfg.getPlanItemBehaviorFactory() == null)\n    throw new IllegalStateException(\"No PlanItemBehaviorFactory configured\");","typeGuard":null,"tryCatchPattern":"try {\n    startPlanItem();\n} catch (FlowableException e) {\n    if (e.getMessage().endsWith(\"does not have a behavior\")) {\n        // register behavior for the plan item definition type\n    }\n}","preventionTips":["Register behaviors for every custom plan item definition type used in models.","Keep custom behavior classes on the engine classpath.","Test-deploy models with all definition types before production."],"tags":["cmmn","behavior","configuration"],"backgroundTag":"missing-dependency","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"}