{"record":{"id":"67d9d6bc78311fc5","repo":"flowable/flowable-engine","slug":"string-value-value-is-not-allowed-in-boolean","errorCode":null,"errorMessage":"String value \"${value}\" is not allowed in boolean expression","messagePattern":"String value \"(.+?)\" is not allowed in boolean expression","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/ExpressionUtils.java","lineNumber":56,"sourceCode":"        }\n        return 0;\n    }\n\n    public static boolean getBooleanFromField(final Expression expression, final VariableContainer execution) {\n        if (expression != null) {\n            Object value = expression.getValue(execution);\n            return parseBoolean(value);\n        }\n        return false;\n    }\n\n    protected static boolean parseBoolean(Object value) {\n        if (value != null) {\n            if (value instanceof String stringValue) {\n                if (\"true\".equalsIgnoreCase(stringValue) || \"false\".equalsIgnoreCase(stringValue)) {\n                    return Boolean.parseBoolean(value.toString());\n                }\n                throw new FlowableException(\"String value \\\"\" + value + \"\\\" is not allowed in boolean expression\");\n            }\n            if (value instanceof Boolean) {\n                return (Boolean) value;\n            }\n            throw new FlowableException(\"Value \\\"\" + value + \"\\\" can not be converted into boolean\");\n        }\n        return false;\n    }\n\n    public static String getStringFromField(final Expression expression, final VariableContainer execution) {\n        if (expression != null) {\n            Object value = expression.getValue(execution);\n            if (value != null) {\n                return value.toString();\n            }\n        }\n        return null;\n    }","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/ExpressionUtils.java#L38-L74","documentation":"ExpressionUtils.parseBoolean converts a resolved field value to a boolean. Strings are only accepted when they equal 'true' or 'false' ignoring case; any other string (e.g. 'yes', '1', 'on', or an expression that failed to resolve to a boolean) triggers this FlowableException. It exists to prevent silently treating arbitrary strings as false.","triggerScenarios":"A boolean-typed HTTP task field (e.g. saveRequestVariablesToResult, saveResponseParameters, or a failStatus/dispatch-related flag) is given a String value other than 'true'/'false', typically via an expression that resolves to text like 'yes' or 'Y'.","commonSituations":"Configuring task attributes with 'true'/'false' vs 'yes'/'no' conventions from other systems; a variable holding 'True ' with trailing whitespace is fine (equalsIgnoreCase) but 'enabled' is not; locale-specific representations.","solutions":["Change the expression/attribute value to literal true or false (string, case-insensitive)","Fix the supplying variable so it contains 'true'/'false' instead of 'yes'/'no'/'1'/'0'","If the value comes from user input, normalize it before the task (e.g. in a listener)","Use a Boolean-typed field/expression instead of a String where supported"],"exampleFix":"// before\n<flowable:httpTask saveResponseParameters=\"yes\" />\n// after\n<flowable:httpTask saveResponseParameters=\"true\" />","handlingStrategy":"validation","validationCode":"Object v = execution.getVariable(\"flag\");\nif (v instanceof String s && !(s.equalsIgnoreCase(\"true\") || s.equalsIgnoreCase(\"false\"))) {\n    throw new IllegalArgumentException(\"flag must be 'true' or 'false'\");\n}","typeGuard":"boolean isValidBoolString(Object v) { return v == null || (v instanceof String s && (s.equalsIgnoreCase(\"true\") || s.equalsIgnoreCase(\"false\"))); }","tryCatchPattern":"try {\n    delegate.execute(execution);\n} catch (FlowableException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"not allowed in boolean expression\")) {\n        // normalize the variable to true/false and retry once\n    } else { throw e; }\n}","preventionTips":["Use literal true/false for boolean task attributes","Normalize yes/no/1/0 values to booleans at variable creation time","Prefer Boolean-typed variables over Strings for flags"],"tags":["flowable","boolean","expression","type-conversion"],"backgroundTag":"invalid-argument-value","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"}