0

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.

emkuel5
  • 11
  • 2
  • If you show the ARL code (from the ARL tab in the action rule editor) for the second rule, it may help figure out what is going on. – Greg Hadaller Feb 14 '21 at 02:33
  • Have you inspected the swagger JSON file to verify everything is as you expect? (To view it: from Explorer tab in RES, select the rule set. Then select 'Retrieve HTDS Description File'. Then select REST, JSON, and 'View'.) – Greg Hadaller Feb 14 '21 at 02:35
  • thanks for replying. Unfortunately, the json does not get generated there, I have a persistent error there which I was never able to solve for months now. I get an error message whenever I access that page. Pasting a manually generated json works though. – emkuel5 Feb 16 '21 at 17:51

1 Answers1

0

I found the problem, I mistakenly used 2 superclasses when defining this (Object and Enum).

Using only one (Object, as defined in the linked tutorial) solved the problem

emkuel5
  • 11
  • 2