2

I am using RedHat Business Central and trying to call one DMN file from another.

Use case - if salary > 40000 then calculate Tax from firstdmn else from seconddmn.

enter image description here

I have added a context and literal expression in the Tax DMN decision and included a model below. But Don't know how to proceed further. Please suggest what to do.

enter image description here

tarilabs
  • 2,178
  • 2
  • 15
  • 23
Avijit
  • 1,770
  • 5
  • 16
  • 34

1 Answers1

5

Use case - if salary > 40000 then calculate Tax from firstdmn else from seconddmn. [...] But Don't know how to proceed further. Please suggest what to do.

Here is an example using Red Hat Business Central, the Drools DMN open source engine and Scenario Simulation. Also this example is making use of best practices from DMN methodologies advising for Import and re-use of Business Knowledge Model nodes (or alternatively Decision Services)

Starting with a skeleton of the model as partially suggested you suggested:

step1

In this model, we defined a BKM for a function that calculates Tax as 20% (mnemonic: this is the first DMN model, so ten percent). This is represented with the BKM called Tax10.

Then we define in the second DMN model, a BKM for a function that calculates Tax as 20% (mnemonic: second DMN model, twenty percent): step2

We go back to the first DMN model, and we Import the second one we just defined: step3

We can now include the imported BKM from the second model, into the DRG: step4

Now the FEEL literal expression matches your original requirement: step5

We can use Scenario Simulation to verify, test and non-regression test the requirements: scesim

This is as expected, when salary is above 40K we used Tax10, else from second model we used Tax20.

tarilabs
  • 2,178
  • 2
  • 15
  • 23
  • It's working. I need one more help. I want to add my git repo instead of the default git with Business Central. If you have any details please let me know. – Avijit Apr 17 '20 at 21:46
  • Please open another question or alternatively ask about git setup in the Drools Setup forum https://groups.google.com/forum/#!forum/drools-setup – tarilabs Apr 18 '20 at 06:00
  • Question for update default git repository - https://stackoverflow.com/questions/61296998/change-default-git-repository-of-business-central-dmn-rule – Avijit Apr 18 '20 at 22:17
  • I'm looking for the exact same thing, but instead of having a different function, I need to use a different DMN to make the decision, any ideas? https://stackoverflow.com/questions/68832897/dmn-table-per-condition – josesuero Aug 18 '21 at 14:12