Bulk Load Input Data and Decision Logic from Excel to DMN Editor

460 views
Skip to first unread message

Swathy M

unread,
Jan 25, 2022, 2:48:22 AM1/25/22
to Kogito development mailing list
Hi, I have been using Decision Tables to implement some Business Logic. I would like to know if there is a method to bulk load input data and decision logic from an excel sheet directly into the DMN Editor. We have use cases consisting of 1000 rules, which makes manually entering the data to the editor really time consuming and difficult. That is why we are looking for a bulk upload functionality.
Thank you

Matteo Mortari

unread,
Jan 26, 2022, 2:37:48 PM1/26/22
to Kogito development mailing list
HI Swathy,

There is currently available a capability to achieve what you're looking for, by using a simple command line utility.

We have a capability to convert an Excel file, if it follows some specific convention, into an equivalent DMN file.
Both the requirements how to structure the Excel, and how to convert it is described in this readme:
including some examples too.

Alternatively, the same utility is available as a JBang script, as shown in this blog post: https://blog.kie.org/2021/09/a-kie-jbang-catalog.html

We are considering adding some other small improvements to this capability, so if you have feedback don't hesitate to share.

Hope this helps!
MM

On Tue, 25 Jan 2022 at 08:48, Swathy M <swathyp...@gmail.com> wrote:
Hi, I have been using Decision Tables to implement some Business Logic. I would like to know if there is a method to bulk load input data and decision logic from an excel sheet directly into the DMN Editor. We have use cases consisting of 1000 rules, which makes manually entering the data to the editor really time consuming and difficult. That is why we are looking for a bulk upload functionality.
Thank you

--
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/2dcf4a29-d02a-4801-8481-f9722e286b4an%40googlegroups.com.


--

Swathy M

unread,
Jan 27, 2022, 8:28:32 AM1/27/22
to Kogito development mailing list
Thank you Matteo, that was indeed helpful :)
We were thinking if we can have functionality to implement other decision blocks like Context and Literal Expression through Excel. That would add robust functionality to automating the rule defining process from Excel. Also, will there be a provision to specify the datatypes and Hit Policy in the excel file itself.
What's your thought process around that and just want to get an idea what will be the direction on that part from Kie developer community.
Thank you,
Swathy

Nathan Haws

unread,
Jan 27, 2022, 9:40:52 AM1/27/22
to Kogito development mailing list
Yes! This is exactly what I was looking for for uploading some actuarial tables more efficiently. Thanks!

Ravi Mangalagiri

unread,
May 4, 2022, 8:55:44 AM5/4/22
to Kogito development mailing list
Matteo,
Is this project active? I tried to generate a few DMNs from Excel and works great!
It only generates v1.2 DMN and when I switch to org.kie.dmn.model.v1_4 it fails to generate.

Can you point me to any sample if exists,  to generate data types and map it to each fact type in the decision table

Thanks
Ravi

Matteo Mortari

unread,
May 4, 2022, 9:37:56 AM5/4/22
to Kogito development mailing list
Hi Ravi,
the project is active as it's continually integrated for non-regression, but it's a community contributed experiment at this stage.

I'm not sure there is specific advantage in the serialization format, since Decision Table(s) (which is the focus of this translator) works fine since DMN v1.2 and the engine do anyway support v1.1, v1.2, v1.3 and v1.4 at their Conformance level 3 anyway.

I would expect this translator to work as intended in generating the DMN model output, per unit and integration test.
If it's not working, can you share a reproducer by providing the excel file which is causing the trouble?

Hope this helps,
MM

Ravi Mangalagiri

unread,
May 4, 2022, 10:22:28 AM5/4/22
to Kogito development mailing list
Thanks Matteo for the quick response.

I would like to contribute to this project. 

I am the getting the following error

image.png




--
Ravi Mangalagiri

Matteo Mortari

unread,
May 4, 2022, 10:34:11 AM5/4/22
to Kogito development mailing list
Thank you for your interest in contributing to these projects, Ravi !

The error you show in the screenshot is a bit difficult to investigate from just 1 image, but I suspect it might be related to some marshalling configuration which is missing to be updated.

My suggestion is however to consider also from a DMN Editor (Tooling) point of view.
Since the DMN Editor is currently able to open up to v1.3 inclusive, but anyway will persist again to v1.2, I don't see a need to update the produced serialization, which would be lost on editor anyway.
Additionally, I would not update this translator to v1.4 in any case, since the DMN Editor is not able to open that version.

and attached screenshot.

Just to reiterate, as the engine is able to evaluate and fully conform to any version v1.1, v1.2, v1.3 and v1.4 inclusive, it is currently emitting v1.2 as it doesn't make much difference for the Decision Table perspective, and is the most sensible target to ease the DMN Editor integration later down the line.

Hope this clarifies?
MM


Screenshot 2022-05-04 at 16.26.44.png

Ravi Mangalagiri

unread,
May 4, 2022, 10:47:42 AM5/4/22
to Kogito development mailing list
Thanks for the clarification.




--
Ravi Mangalagiri

Ravi Mangalagiri

unread,
May 4, 2022, 11:03:30 AM5/4/22
to Kogito development mailing list
I am thinking of adding another sheet that describes data types so that I can associate them during translation.
 was looking for dmn-cli code base which does from java classes to dmn, can you refer me to the gitrepo

Thanks
Ravi
--
Ravi Mangalagiri

Matteo Mortari

unread,
May 4, 2022, 11:35:30 AM5/4/22
to Kogito development mailing list
I think it's a great idea worth exploring!

To add to that idea, a complementary approach could be to stick to the most-appropriate-tool for each context.
Decision Table? -> Excel
Data type definition? -> JSON Schema

So I would look for a way an end-User defines the types in a JSON Schema.
Then, in Excel, you refer to those JSON Schema types --say, by name in a cell comment of the input column

I believe this way, you could combine the best-of-the-breed technologies in each context where they shine the most.

What do you think?
MM



Ravi Mangalagiri

unread,
May 4, 2022, 12:26:33 PM5/4/22
to Kogito development mailing list
Makes sense. Is there a reusable code to read from json scheam to generate default dmn template with data types. I can then map each cell header to DMN type-ref

Thanks
Ravi

You received this message because you are subscribed to a topic in the Google Groups "Kogito development mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kogito-development/RjVZ852h6dA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/CAHOoiEpRGqKW1i3dtPzeiSr2C__T7L_BpAW4VSBmbiwhWTZtoQ%40mail.gmail.com.


--
Ravi Mangalagiri

Matteo Mortari

unread,
May 5, 2022, 3:44:32 AM5/5/22
to Kogito development mailing list
Hi Ravi,

you will find existing code for the other way around: from the ItemDefinition, producing some JSON Schema as accepted by the Swagger/OpenAPI specification. It's not exactly what you have been asking, but I expect it's relevant anyway; similarly the SmallRye library used there could be used for parsing JSON Schema (or a JSON Schema from within a Swagger/OpenAPI descriptor). Having the other way around already on-hand, could help you there.

You have been asking about the "dmn cli" community contributed, but from this page I don't see the source available: https://www.npmjs.com/package/dmn-cli
Maybe the Tooling team can advise here?

Hope this helps,
MM

Ravi Mangalagiri

unread,
May 5, 2022, 8:17:37 AM5/5/22
to Kogito development mailing list
Ok this is a good starting point. Thanks Matteo



--
Ravi Mangalagiri

Matteo Mortari

unread,
May 5, 2022, 8:32:44 AM5/5/22
to Kogito development mailing list
Always glad to help Ravi !

Just a friendly reminder, if you are planning on submitting a PR as an external contributor to any kiegroup repo, imho is best to start "small", this always eases the conversations in general and broader changes/improvement can always be broken down into smaller composable pieces :)

Also don't hesitate to continue to engage in these conversations! 👍

MM

Message has been deleted

Matteo Mortari

unread,
Mar 28, 2023, 10:28:04 AM3/28/23
to kogito-de...@googlegroups.com
Hi Anshul,

Please let's keep the threads on topic and avoid cross-posting.

Thank you for your understanding,
MM

On Tue, 28 Mar 2023 at 15:59, 'Anshul Agarwal' via Kogito development mailing list <kogito-de...@googlegroups.com> wrote:
Hi everyone,

i tried creating DMN through excel files, but didn''t see any example where i can create DMN Business knowledge model from it. Is it possible to do that through this CLI ?

[DISCLAIMER]: This email message, including any attachment(s), is intended only for the named recipient(s) and may contain confidential, proprietary or legally privileged information. Unauthorized individuals or entities are not permitted access to this information. Any dissemination, distribution, disclosure, or copying of this information is unauthorized and strictly prohibited. If you have received this message in error, please advise the sender by reply email, and delete this message and any attachments.

--
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.


--
Reply all
Reply to author
Forward
0 new messages