{"record":{"id":"cc2e144d39aa5a55","repo":"flowable/flowable-engine","slug":"behavior-behavior-is-not-supported-for-a-case-t","errorCode":null,"errorMessage":"Behavior ${behavior} is not supported for a case task for ${execution}","messagePattern":"Behavior (.+?) is not supported for a case task for (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/TriggerCaseTaskCmd.java","lineNumber":76,"sourceCode":"        \n        FlowElement flowElement = execution.getCurrentFlowElement();\n        if (!(flowElement instanceof CaseServiceTask caseServiceTask)) {\n            throw new FlowableException(\"No execution could be found with a case service task for \" + execution);\n        }\n\n        Object behavior = caseServiceTask.getBehavior();\n        if (behavior instanceof CaseTaskActivityBehavior) {\n            ((CaseTaskActivityBehavior) behavior).triggerCaseTaskAndLeave(execution, variables);\n        } else if (behavior instanceof MultiInstanceActivityBehavior) {\n            AbstractBpmnActivityBehavior innerActivityBehavior = ((MultiInstanceActivityBehavior) behavior).getInnerActivityBehavior();\n            if (innerActivityBehavior instanceof CaseTaskActivityBehavior) {\n                ((CaseTaskActivityBehavior) innerActivityBehavior).triggerCaseTask(execution, variables);\n            } else {\n                throw new FlowableException(\"Multi instance inner behavior \" + innerActivityBehavior + \" is not supported for \" + execution);\n            }\n            ((MultiInstanceActivityBehavior) behavior).leave(execution);\n        } else {\n                throw new FlowableException(\"Behavior \" + behavior + \" is not supported for a case task for \" + execution);\n        }\n\n        return null;\n    }\n}\n","sourceCodeStart":58,"sourceCodeEnd":82,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/TriggerCaseTaskCmd.java#L58-L82","documentation":"After excluding CaseTaskActivityBehavior and MultiInstanceActivityBehavior, the case task element's behavior is of an unrecognized type, so TriggerCaseTaskCmd cannot trigger it and throws FlowableException. This is a model/behavior wiring problem: the element does not behave as a triggerable case task.","triggerScenarios":"The execution's caseServiceTask (or its behavior field) was customized/replaced with a custom ActivityBehavior or an incompatible behavior class, then triggered via the case-task trigger path.","commonSituations":"Custom behavior factories or process-engine config overriding default behaviors; engine upgrades where behavior classes changed; manual manipulation of activity behavior in code.","solutions":["Ensure the case task element uses CaseTaskActivityBehavior (or MultiInstance wrapping it)","Remove custom behavior overrides that replaced the default case-task behavior","Check for engine version mismatches between deployed models and the Flowable runtime","Register proper support in the custom behavior factory if the behavior is intentionally custom"],"exampleFix":"// before: custom behavior replacing case task\nactivity.setBehavior(new MyCustomBehavior());\n// after: keep the standard case-task behavior\nactivity.setBehavior(new CaseTaskActivityBehavior());","handlingStrategy":"validation","validationCode":"ActivityBehavior b = caseServiceTask.getBehavior();\nif (!(b instanceof CaseTaskActivityBehavior) && !(b instanceof MultiInstanceActivityBehavior)) {\n    throw new IllegalStateException(\"unsupported case task behavior: \" + b.getClass());\n}","typeGuard":"boolean hasSupportedCaseTaskBehavior(FlowElement el) {\n    return el instanceof CaseServiceTask cst && cst.getBehavior() instanceof CaseTaskActivityBehavior;\n}","tryCatchPattern":"try {\n    trigger(executionId, vars);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Behavior \")) {\n        // restore the default CaseTaskActivityBehavior for this element\n    }\n}","preventionTips":["Avoid replacing default behaviors on case tasks with custom implementations","Pin the Flowable engine version and re-test custom behavior factories on upgrade","Log behavior class names in diagnostics to catch wiring regressions early"],"tags":["case-task","behavior","unsupported-operation","customization"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}