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.
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.
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:
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):
We go back to the first DMN model, and we Import the second one we just defined:
We can now include the imported BKM from the second model, into the DRG:
Now the FEEL literal expression matches your original requirement:
We can use Scenario Simulation to verify, test and non-regression test the requirements:
This is as expected, when salary is above 40K we used Tax10, else from second model we used Tax20.