List input to decision table

125 views
Skip to first unread message

rishab raina

unread,
Feb 9, 2024, 4:29:58 AM2/9/24
to Kogito development mailing list
Hi

I have a scenario where my input to the dmn will be like a list structure 

{
    "input": [
        {
            "endpoint": "xyz",
            "app_name": "app1",
            "key": "platform_product_app_xyz",
            "status": "ok"
        },
        {
            "endpoint": "abx",
            "app_name": "app1",
            "key": "platform_product_app_abx",
            "status": "warning"
        },
        {
            "endpoint": "abz",
            "app_name": "app3",
            "key": "platform_product_app_abxz",
            "status": "not ok"
        }
    ]
}

my decision table will have a structure like 

Screenshot 2024-02-09 at 2.58.17 PM.png

how can i match / check / compare rows in the table  with the json list i am getting in input ?

Regards
Rishab

Richard Bourner

unread,
Feb 9, 2024, 11:55:23 AM2/9/24
to Kogito development mailing list
One good way is to store your Decision Table in a BKM, and then loop through your list using a Feel expression to invoke that BKM.  
Then you will collect a list of result, the same size as your input list.

Rhett S

unread,
Feb 9, 2024, 12:34:10 PM2/9/24
to kogito-de...@googlegroups.com
i agree. you iterate through the array, and call the DT for each item in the array, all the while adding output to your accumulating output-list. very similar to MAP in js/java.


--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/aa1cfada-0dad-4c9c-b4d2-9a86ae2a6a24n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages