1
votes

I have a small project created on drools workbench deployed on a KIE server. Using the rest API I am able to insert facts, with rules appropriately fired. However the rules included in guided decision tables do not fire. Here is an example of a request I would send to the KIE server:

<batch-execution lookup="defaultKieSession">
<insert out-identifier="applicant" return-object="true" entry-point="DEFAULT">
    <models.Applicant>
        <timeEmployed>35</timeEmployed>
        <employmentStatus>Contract</employmentStatus>
        <violations>[]</violations>
    </models.Applicant>
</insert>
<fire-all-rules/>
</batch-execution>

All rules that this data should trigger are fired, except for those included in the Decision table.

When I run a test scenario with the same data, all rules, including the decision table's rules, are fired correctly: enter image description here The problem seems to be related to the use of the REST API. Any ideas as to what I am doing wrong?

Here is the Table in question: enter image description here

Violation simply calls a method that appends an error to the violations array.

Inside kmodule.xml I have.

<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

Clarification Just to be clear my requests fire rules from Guided DRLs, my issue is only with the rules in guided rules table. For example:

Given the rule: enter image description here

If I send this request: 1994-04-15 11:03:44-0000 1970-01-13 16:19:41-0024 Contract 35 []

This is a fragment of the response:

enter image description here

This data should also match the rule in the gdst however it is not fired.

1
could you share how your dtable looks like? And also the content of your kmodule.xml file. - Esteban Aliverti

1 Answers

0
votes

While we can't see the condition operators in the table, my guess is the criteria doesn't meet any of the decision table rows/rules.

Mapping the input data to the decision table, we can see that:

  1. Employment Status is Contract, so that matches row 1. In rows 3-11 it is ignored, so depends on the matching of the remaining columns.
  2. Employment Duration is probably timeEmployed, and it does not match equality of any row. If the column operator is >, it matches rows 2-11. If it is <, then it matches row 1.
  3. Job Category is ignored for rows 1 and 2, and has no apparent matching value in the input so rows 3-11 do not match.

Based on those:

  • 3 says only rows 1 and 2 could match
  • 1 says only row 1 could match of rows 1 and 2
  • 2 is indeterminate based on what we see

My guess is row 1 is close but #2 doesn't match.