How to get all rules from DMN table JAVA

I have some DMN rule like

Input Season
Spring → output → rainy, 25C
Winter → output → snow, -5C

I like to get all rule like

{
   "ListOfRule":[
      {
         "Season":"Spring",
         "env":"rainy",
         "temperature":"25"
      },
      {
         "Season":"Winter",
         "env":"snow",
         "temperature":"-5"
      }
   ]
}

my java code loop all seasons to get a result

      List<String> seasons =  Arrays.asList("Spring", "Winter", "Fall");

      for (String season: seasons) {

        VariableMap variables = Variables
                .putValue("season", season);
        
        DmnDecision decision = dmnEngine.parseDecision("decision", inputStream);
        // evaluate decision
        DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);
      }

not sure this is the right way to get a result because this code loop all table to get the result

thanks

Can you explain a little bit about why you’re doing this?

I think it is to manage master data through dmn.

E.g,
as-is: code name is managed by the database table
to-be: Managed by the dmn engine.

Although it can be achieved by loading dmn xml and traversing nodes,
But this should not be a best practice, right?

Hi @Niall
I would like to store some master data in the DMN & would like to retrieve in the input & output in Java code and need to do some business logic. Could you please help me how to do that ?

Thanks in Advance