apache / incubator-kie-issues

Apache License 2.0
12 stars 1 forks source link

The difference in Rules when using the sandbox from apache/incubator-kie-sandbox-webapp:main and quay.io/kie-tools/kie-sandbox-image:0.32.0. #1645

Closed kanetran closed 3 days ago

kanetran commented 5 days ago

Description: I have defined a rule as follows in DMN 1.2 (with quay.io/kie-tools/kie-sandbox-image:0.32.0):

image

When I tried using apache/incubator-kie-sandbox-webapp:main, it didn’t work as expected.

image

I would like to ask:

  1. Does apache/incubator-kie-sandbox-webapp:main use DMN 1.5?
  2. Starting from versions after DMN 1.2, Decision Table (DT) analysis static became available. Is this the reason for the above error?
  3. I read in some places that the ? symbol or dynamic comparisons no longer work well in versions >= DMN 1.3. So, is it correct to set a static column like subscriptionFrom < '12-Dec-2022' and evaluate it as true/false? If yes, is there any way for me to handle this? Because in my rule file, I have many comparisons of this type (subscriptionFrom < '12-Dec-2022' and productCode == $pp.productCode). If I do this, it will result in a lot of additional columns.
  4. If all the above conditions are correct, is there a way for me to disable Decision Table (DT) analysis static in the Dockerfile?
jomarko commented 4 days ago

Hi @kanetran

  1. yes, latest sandbox webapp uses DMN 1.5
  2. static analysis just report found issues, I think it reports some valid issues [1]
  3. where do you read this about ? please, see also my points [1]
  4. You can turn off extended-services, that will stop the static analysis, however also the DMN Runner will be disabled in such case, basically the feature under Run button will be disabled

One more general comment about DRL vs DMN. They are similar, but different.

  1. DMN Can not update an object, only construct a new one.
  2. Your DRL will automatically try to match agains all possible pairs of ProductPricing and SubscriptionPricingModel while the DMN function will try to match against single pair of ProductPricing and SubscriptionPricingModel.

[1]

  1. the question mark is not needed in your decision table, please use >= date and time(2023,10,1,0,0,0)
  2. not takes as an argument boolean while you pass a string, so you can replace your not with a unary test like != pp.promotionCode
yesamer commented 3 days ago

Closing as an answer has been provided (thank you @jomarko)