DMN datatype from json schema

178 views
Skip to first unread message

Marco Iannelli

unread,
Mar 21, 2024, 1:28:18 PM3/21/24
to Kogito development mailing list
Dear All,
I have my datamodel define as json schema in several files;
Is there any functionality available to import those files as datatype in dmn?

from DMN 1.4 (Chapter 7.3.3 ItemDefinition metamodel) specification the following is mentioned:

The inputs and output of decisions, business knowledge models, and decision services, and the output of input data (all DRGElements) are data items whose value, at the logic level, is assigned to variables or represented by expressions.

... An important characteristic of data items in decision models is their structure. DMN does not require a particular format for this data structure, but it does designate a subset of FEEL as its default. ...

The default type language for all elements can be specified in the Definitions element using the typeLanguage attribute. For example, a typeLanguage value of http://www.w3.org/2001/XMLSchema” indicates that the data structures used by elements within that Definitions are in the form of XML Schema types. If unspecified, the default is FEEL.


thank you for your input
best regards
Marco

Rhett S

unread,
Mar 26, 2024, 12:34:25 PM3/26/24
to Kogito development mailing list
Hey Marco, there is no OOTB tool to convert data models in JSON to DMN-XML that I know of. 
However, it is possible to programmatically convert from JSON <--> XML in a deterministic manner. In java for instance, de/serializing from JSON to XML is trivial using annotations- or other ways- your preference.
If i remember correctly, the only thing that tripped up easy-peasy-conversion was the colons in the tags. 
Rhett

Marco Iannelli

unread,
Mar 28, 2024, 6:01:45 AM3/28/24
to Kogito development mailing list
Hi Rhett,
thank you for your answer. once; once i have the xml, what would be the next steps? 
BR
Marco

Gabriele Cardosi

unread,
Mar 29, 2024, 3:22:38 AM3/29/24
to Kogito development mailing list
Hi Marco,
I read your email some days ago, and I found the use-case extremely interesting.
I talked with the guys working at tooling, and they also see it would be a very useful feature.
For the moment being, this is the ticket we created:
https://github.com/apache/incubator-kie-issues/issues/1050
(unfortunately, I can not provide any estimation).
About your original question, in the past this is the approach we followed to address similar issue (not exactly the same):
https://github.com/apache/incubator-kie-tools/tree/3daeaf23be1fa78bdaaf0869c8bf387ed600726e/packages/stunner-editors/drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-kogito-marshaller

Mind you, probably you can't follow exactly the same, and probably you would need to do that purely in Java; but it is just an example

Best 

Gabriele

Rhett S

unread,
Apr 1, 2024, 2:58:54 PM4/1/24
to kogito-de...@googlegroups.com
Hey Marco, there is no OOTB tool to convert data models in JSON to DMN-XML that I know of. 
However, it is possible to programmatically convert from JSON <--> XML in a deterministic manner. In java for instance, de/serializing from JSON to XML is trivial using annotations. I've done it in hackathon. 
If i remember correctly, the only thing that tripped up easy-peasy-conversion was the colons in the tags. 
Rhett
--
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/8bb95687-bd65-4fd0-86c4-7c400a3c3b54n%40googlegroups.com.

Marco Iannelli

unread,
Apr 1, 2024, 2:59:26 PM4/1/24
to kogito-de...@googlegroups.com
Hi Rhett,
Thanks for your answer. Once I have the xml from the json, what i need to do?


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

Gabriele Cardosi

unread,
Apr 1, 2024, 2:59:26 PM4/1/24
to kogito-de...@googlegroups.com
Hi Marco,
I read your email some days ago, and I found the use-case extremely interesting.
I talked with the guys working at tooling, and they also see it would be a very useful feature.
For the moment being, this is the ticket we created:
https://github.com/apache/incubator-kie-issues/issues/1050
(unfortunately, I can not provide any estimation).
About your original question, in the past this is the approach we followed to address similar issue (not exactly the same):
https://github.com/apache/incubator-kie-tools/tree/3daeaf23be1fa78bdaaf0869c8bf387ed600726e/packages/stunner-editors/drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-kogito-marshaller

Mind you, probably you can't follow exactly the same, and probably you would need to do that purely in Java; but it is just an example

Best 

Gabriele



Reply all
Reply to author
Forward
0 new messages