I followed the tutorial here to create a static enum
For a domain value EXAMPLE, I would verbalise it to 'Example' and manually define the Getter (in ARL) as return "Example"; as explained in the tutorial.
Then I define an input/output variable myDomainExample and try testing it through the REST API.
If I write a dummy rule such as:
then
set 'my domain example' to Example;
I get this json result:
{
"__DecisionID__": "144805689948397501147221553",
"myDomainExample ": "Example"
}
If I write the following dummy rule though:
if
'my domain example' is Example
then
set 'my domain example' to Example;
and I enter the following json payload:
{
"__DecisionID__": "144805689948397501147221553",
"myDomainExample ": "Example"
}
I get this error message:
java.lang.ClassCastException: java.lang.String incompatible with java.lang.Enum
Does anyone know what is causing this?
I also tried using capital letters and it didn't work either.
I could alternatively write a Java class for this domain but I'd rather not.
question from:
https://stackoverflow.com/questions/66049009/classcastexception-string-vs-enum-when-using-static-domain-in-ibm-odm 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…