alibaba/spring-ai-alibaba · error · IllegalArgumentException

Not support dslValue: [${dslValue}] for type: [${variableTyp

Error message

Not support dslValue: [${dslValue}] for type: [${variableType.value()}]

What it means

Thrown by ComparisonOperatorType.fromDslValue when no comparison operator matches both the given DSL string value (per dialect) and the variable type. It is a lookup failure against the enum's supported operator table.

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/model/workflow/ComparisonOperatorType.java:204

	private final BiFunction<String, String, String> toJavaExpression;

	ComparisonOperatorType(String value, Function<DSLDialectType, String> dslValueFunc,
			List<VariableType> supportedTypes, BiFunction<String, String, String> toJavaExpression) {
		this.value = value;
		this.dslValueFunc = dslValueFunc;
		this.supportedTypes = supportedTypes;
		this.toJavaExpression = toJavaExpression;
	}

	public static ComparisonOperatorType fromDslValue(DSLDialectType dialectType, String dslValue,
			VariableType variableType) {
		for (ComparisonOperatorType comparisonOperatorType : ComparisonOperatorType.values()) {
			if (comparisonOperatorType.dslValueFunc.apply(dialectType).equals(dslValue)
					&& comparisonOperatorType.supportedTypes.contains(variableType)) {
				return comparisonOperatorType;
			}
		}
		throw new IllegalArgumentException(
				"Not support dslValue: [" + dslValue + "] for type: [" + variableType.value() + "]");
	}

	public String convert(String objName, String constValue) {
		return this.toJavaExpression.apply(objName, constValue);
	}

	public String getValue() {
		return value;
	}

	public String getDslValue(DSLDialectType dialectType) {
		return dslValueFunc.apply(dialectType);
	}

}

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Check the dslValue string against the DSLDialectType's canonical operator spelling
  2. Confirm the variableType is one supported by that operator (supportedTypes contains it)
  3. Re-export the DSL from a compatible source version
  4. Add or map the missing operator in ComparisonOperatorType if it is a legitimately new operator

Example fix

// before
ComparisonOperatorType.fromDslValue(dialect, "contains_any", VariableType.STRING);
// after — use an operator valid for the type
ComparisonOperatorType.fromDslValue(dialect, "contains", VariableType.STRING);
Defensive patterns

Strategy: validation

Validate before calling

boolean valid = Arrays.stream(ComparisonOperatorType.values()).anyMatch(op -> op.supportedTypes.contains(variableType)); // plus dialect-specific value check

Type guard

ComparisonOperatorType safeFromDslValue(DSLDialectType d, String v, VariableType t) { try { return ComparisonOperatorType.fromDslValue(d, v, t); } catch (IllegalArgumentException e) { return null; } }

Prevention

When it happens

Trigger: Parsing an imported workflow DSL (Dify or Studio dialect) whose comparison operator string is misspelled, from an unsupported dialect variant, or whose operator is not valid for the declared variable type (e.g. '>' on a string-typed variable).

Common situations: Hand-edited DSL files, DSLs exported from a newer/older Dify version with new operator names, operator/type mismatch in if-else node conditions.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09). Data as JSON: /api/errors/708ec643c0c724f9. Report an issue: GitHub.