Building on knowledge I have gained from the tutorials.
I have the following dish order object that is passed into my DMN model.
public class AllergyOrderDto implements Serializable {
private static final long serialVersionUID = 11L;
private String name;
private String dish;
private List<String> allergies;
private String singleAllergy;
// getters setters etc
}
And this is my decision table
This gets passed into my decision table. Now the following decision works.
Request
{
"name" : "Robs Order",
"singleAllergy" : "PEANUTS",
}
Response. Correctly matches the right dish. a nice salad without any nuts or wheat
{
"name": "Robs Order",
"dish": "LIGHT SALAD",
"singleAllergy": "PEANUTS"
}
So far so good. However what I’m trying to do next is pass in a list of allergies into the order. Replacing singleAllergy with an array of allergies represented as a list of strings.
Request very similar to previous
{
"name" : "Robs Order",
"allergies" : ["PEANUTS","WHEAT"]
}
However I cannot get the DMN working. From reading around the FEEL expression seems to be correct avenue to explore. However Im confused about what to put here?
What should my DMN input statement look like?
allergyOrder.singleAllergy; // old value
allergyOrderDto.allergies.contains(?notsure what this value is?) . // new value
Any help would be much appreciated. Also Besides FEEL are there other options I could explore?