{"record":{"id":"41beb6e8be2129a6","repo":"flowable/flowable-engine","slug":"variable-entity-engine-scope-has-no-variable-servi","errorCode":null,"errorMessage":"Variable entity engine scope has no variable service configuration ${engineType}","messagePattern":"Variable entity engine scope has no variable service configuration (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/TraceableObject.java","lineNumber":77,"sourceCode":"    \n    protected VariableServiceConfiguration getVariableServiceConfiguration() {\n        String engineType = getEngineType(variableInstanceEntity.getScopeType());\n        Map<String, AbstractEngineConfiguration> engineConfigurationMap = Context.getCommandContext().getEngineConfigurations();\n        AbstractEngineConfiguration engineConfiguration = engineConfigurationMap.get(engineType);\n        if (engineConfiguration == null) {\n            for (AbstractEngineConfiguration possibleEngineConfiguration : engineConfigurationMap.values()) {\n                if (possibleEngineConfiguration instanceof HasVariableServiceConfiguration) {\n                    engineConfiguration = possibleEngineConfiguration;\n                }\n            }\n        }\n        \n        if (engineConfiguration == null) {\n            throw new FlowableException(\"Could not find engine configuration with variable service configuration\");\n        }\n        \n        if (!(engineConfiguration instanceof HasVariableServiceConfiguration)) {\n            throw new FlowableException(\"Variable entity engine scope has no variable service configuration \" + engineType);\n        }\n        \n        return (VariableServiceConfiguration) engineConfiguration.getServiceConfigurations().get(EngineConfigurationConstants.KEY_VARIABLE_SERVICE_CONFIG);\n    }\n    \n    protected String getEngineType(String scopeType) {\n        if (StringUtils.isNotEmpty(scopeType)) {\n            return scopeType;\n        } else {\n            return ScopeTypes.BPMN;\n        }\n    }\n}\n","sourceCodeStart":59,"sourceCodeEnd":91,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/TraceableObject.java#L59-L91","documentation":"After TraceableObject finds an engine configuration, it verifies it implements HasVariableServiceConfiguration. This FlowableException is thrown when an engine configuration was found for the scope's engine type but that configuration does not expose a variable service configuration, so the variable service cannot be obtained.","triggerScenarios":"A scope type resolves (via getEngineType) to an engine whose configuration class does not implement HasVariableServiceConfiguration — e.g., a custom or older engine configuration plugged into EngineConfigurations without variable-service support.","commonSituations":"Mixed Flowable versions where a custom engine configuration predates the HasVariableServiceConfiguration interface; registering a custom scope/engine type whose configuration was never extended with variable service support.","solutions":["Make the engine configuration class implement HasVariableServiceConfiguration and return the variable service configuration from getServiceConfigurations()","Verify the scope type string maps to the correct engine (fix the getEngineType mapping or the scope type used)","Upgrade to consistent Flowable module versions so all engine configurations support the variable service contract","Register the variable service configuration under EngineConfigurationConstants.KEY_VARIABLE_SERVICE_CONFIG"],"exampleFix":"// before\npublic class MyEngineConfiguration extends AbstractEngineConfiguration { }\n// after\npublic class MyEngineConfiguration extends AbstractEngineConfiguration implements HasVariableServiceConfiguration {\n    public VariableServiceConfiguration getVariableServiceConfiguration() { return variableServiceConfiguration; }\n}","handlingStrategy":"validation","validationCode":"EngineConfiguration cfg = EngineConfigurations.getEngineConfiguration(engineType);\nif (!(cfg instanceof HasVariableServiceConfiguration)) {\n    throw new IllegalStateException(\"Engine \" + engineType + \" lacks variable service configuration\");\n}","typeGuard":"if (engineConfiguration instanceof HasVariableServiceConfiguration) {\n    VariableServiceConfiguration vsc = ((HasVariableServiceConfiguration) engineConfiguration).getVariableServiceConfiguration();\n}","tryCatchPattern":null,"preventionTips":["Any custom engine configuration must implement HasVariableServiceConfiguration","Keep Flowable module versions aligned so interfaces match","Register KEY_VARIABLE_SERVICE_CONFIG in getServiceConfigurations() for every custom engine"],"tags":["engine-configuration","type-mismatch","variables"],"backgroundTag":"config-type-mismatch","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"}