{"record":{"id":"0c9fcb29f97ff474","repo":"flowable/flowable-engine","slug":"the-variable-value-does-not-have-a-type","errorCode":null,"errorMessage":"The variable value does not have a type","messagePattern":"The variable value does not have a type","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/delete/BatchDeleteCaseConfig.java","lineNumber":383,"sourceCode":"                        query.variableNotExists(variableName);\n                        break;\n                    case NOT_EQUALS_IGNORE_CASE:\n                        //Not exposed on the public API\n                        //query.variableValueNotEqualsIgnoreCase(variableName, (String) extractVariableValue(variableValue, engineConfiguration));\n                        //break;\n                    default:\n                        throw new FlowableIllegalArgumentException(\"Operator \" + operator + \" is not supported for the variable value\");\n                }\n            }\n\n        }\n\n    }\n\n    protected static Object extractVariableValue(JsonNode variableValueNode, CmmnEngineConfiguration engineConfiguration) {\n        String type = variableValueNode.path(\"type\").stringValue(null);\n        if (type == null) {\n            throw new FlowableIllegalArgumentException(\"The variable value does not have a type\");\n        }\n\n        VariableType variableType = engineConfiguration.getVariableTypes()\n                .getVariableType(type);\n        return variableType.getValue(new VariableValueJsonNodeValueFields(variableValueNode));\n    }\n\n    protected static List<String> asStringList(JsonNode node) {\n        if (node != null && node.isArray() && !node.isEmpty()) {\n            List<String> values = new ArrayList<>(node.size());\n            for (JsonNode element : node) {\n                values.add(element.stringValue());\n            }\n            return values;\n        }\n\n        return null;\n    }","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/delete/BatchDeleteCaseConfig.java#L365-L401","documentation":"Thrown by extractVariableValue() when a variable value node in the query JSON lacks a 'type' field. The type string is required to look up the VariableType in the engine's variable type registry and convert the raw JSON fields into a Java value. Without it, no conversion is possible.","triggerScenarios":"A variableValues entry in the batch configuration JSON omits the 'type' key (e.g. only name/operator/value present), or the type name is misspelled.","commonSituations":"Hand-authored batch JSON; serializers that omit the type for primitive values; migrations between engines with different variable serialization formats.","solutions":["Add a 'type' field with a registered variable type name such as 'integer', 'string', 'boolean', 'long', 'date', 'serializable' to each variable value node","Validate the JSON before creating the batch config","Create the batch configuration via the public HistoricCaseInstanceQuery API so types are serialized correctly"],"exampleFix":"// before\n{\"name\":\"count\",\"operator\":\"GREATER_THAN\",\"value\":5}\n// after\n{\"name\":\"count\",\"type\":\"integer\",\"operator\":\"GREATER_THAN\",\"value\":5}","handlingStrategy":"validation","validationCode":"if (variableValue.path(\"type\").stringValue(null) == null) throw new IllegalArgumentException(\"variable value missing type\");\n// also verify the type is registered:\nengineConfiguration.getVariableTypes().getVariableType(typeName); // throws if unknown","typeGuard":"boolean hasType(JsonNode n) { return n != null && n.path(\"type\").stringValue(null) != null; }","tryCatchPattern":"try { createBatch(cmd); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains(\"does not have a type\")) { log.error(\"Add 'type' field to variable value\", e); } throw e; }","preventionTips":["Always include the variable type name in serialized variable values","Only use type names registered in the engine's VariableTypes registry","Let the public API serialize variable values instead of hand-writing JSON"],"tags":["flowable","cmmn","query","json","missing-field","variable-type"],"backgroundTag":"missing-required-config-field","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"}