Linking DMN in drools workbench 7.74

73 views
Skip to first unread message

Balaji

unread,
Apr 29, 2024, 7:35:52 AMApr 29
to Drools Usage
How to link two or more DMN's that is output of the one dmn should be as the input of the second dmn and ouptut should be from the second dmn

Richard Bourner

unread,
Apr 29, 2024, 7:18:59 PMApr 29
to Drools Usage
The easiest is to use a business process to orchestrate your DMNs sequence. 
Then you can pass your data to and from the rule tasks defining your process, and eventually have conditional branching if needed.

Balaji

unread,
Apr 30, 2024, 12:50:32 AMApr 30
to Drools Usage
can you please share me some resources about it?
Thanks in advance!

Gabriele Cardosi

unread,
Apr 30, 2024, 2:37:42 AMApr 30
to drools...@googlegroups.com
Hi Balaji,
depending on your use-case, another option could be to "import" a dmn/decision from one DMN to another one: in this case, the different models get somehow merged, and you may design them to forward data from one decision to another.
This is shown in the dmn-multiple-models-quarkus-example (the "Traffic Violation.dmn" imports the "Imported_Model.dmn").

Hope this could help.
Best

Gabriele  

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/3f6c07fd-64c4-4e14-9ffe-31989873710en%40googlegroups.com.

Balaji

unread,
May 7, 2024, 1:32:05 AMMay 7
to Drools Usage
Screenshot 2024-04-30 104319.pngScreenshot 2024-04-30 104702.png

this is my first dmn and its model

Screenshot 2024-04-30 104853.pngScreenshot 2024-04-30 104536.png

this is my second dmn and its model , now when i give request as salary = 40001 , i should get the response as the tax = 2000 and offer= "granted"
(so that the output from first dmn should fire rules in second dmn)

Gabriele Cardosi

unread,
May 7, 2024, 4:40:04 AMMay 7
to drools...@googlegroups.com
Hi Balaji,
in that specific case, I fail to get the reason to split what seems to be a single decision in twos (basically, IIUC, when salary = 40001 then "taxes = 2000 and offer = "granted" " <-"Tax" and "offer" seems to be strictly coupled).
Anyway, if you could share the actual DMNs, I could have a better understanding.


Best

Gabriele

Balaji

unread,
May 7, 2024, 4:54:07 AMMay 7
to Drools Usage

Thank you for the reply Gabriele,
I have just taken this as a example , my ultimate aim is to link the DMN's so that first DMN's output triggers the second DMN and executes the rules.

Balaji

unread,
May 7, 2024, 9:11:40 AMMay 7
to Drools Usage
Is it possible to link the DMN's?

Gabriele Cardosi

unread,
May 7, 2024, 9:32:20 AMMay 7
to drools...@googlegroups.com
HI Balaji
Please refer to DMN documentation about
Business Knowledge Model metamodel
Decision service metamodel

There are also multiple examples of such implementation, e.g. here (this is interesting because it is very complex and involve multiple, nested, models)

Hope this help

Best

Gabriele

Balaji

unread,
May 8, 2024, 7:57:03 AMMay 8
to Drools Usage
okay, thank you Gabriele !
I have an other doubt , that is how to pass multiple input request to DMN decision table to fire two or more rules in it . That is 
If this is my decision table  
Screenshot 2024-05-08 172250.png
when i give request as "VF" and 6 i get the proper output but if is pass two input that is input is "VF" & 6 AND "HL" & 8, i am not getting the output.
This is the request : 
{
    "model-name":"dmn",
    "decision-name": ["output"],
    "decision-id": [],
    "dmn-context":{
        "vertical":
           [ {
                "input": "VF",
                "input2": 6
            },
            {
                "input":"HL",
                "input2":8
            }]
    }
}


Reply all
Reply to author
Forward
Message has been deleted
0 new messages