global-soft-ba / decisionTable

Apache License 2.0
38 stars 5 forks source link

Rule interpretation: multi values #9

Open chippyash opened 2 years ago

chippyash commented 2 years ago

Hi

Just been having a play with this, this afternoon, converting DMN XML files into Grules. Noticed one thing:

If I have a rule in DMN (as output by Camunda Modeller) such as

<rule id="DecisionRule_1m8dn12">
                <description></description>
                <inputEntry id="UnaryTests_07rc4h2">
                    **<text>"Affluence", "Waste &amp; Food"</text>**
                </inputEntry>

(abbreviated)

The rule comes back as

rule row_0 "DecisionRule_1m8dn12" salience 28 {
 when 
    **(Incident Category.InputClause_1hw1x4x == "Waste & Food")**
    && (Assessed?.InputClause_0yj77qd == true)
    && (Reported Via.InputClause_0q2w1go == "ICS")
    && (In Office Hours?.InputClause_1l34u7d == true)
    && (Incident Severity.InputClause_0vbs4s7 == "cat2")
 then 
    Handler.OutputClause_09njrow = "CO";
 Complete();
}

Pertinent bits surrounded by asterix

I know that the original text is being passed in, so I assume that it is something in the parser spec that you are using? I'd expect a rule that has some kind of OR or IN() comparator.

I don't know enough about Grules, but in your view, is this something that needs to be handled in my pre-processing, or is it something that your parser should handle. In standard DMN, a list of values, separated by commas, is always an OR case.

Anyway, thought I'd ask your opinion.

Kind regards Ashley

tkordic-globalsoft commented 2 years ago

Hi @chippyash,

Our parser should handle this scenario, but there is a bug that prevents the parser from handling disjunctions properly.

We are working on the issue. A fix should be available soon.

Kind regards, Tomislav