[jboss-jira] [JBoss JIRA] (DROOLS-1663) Kie DMN doesn't support IMPORT decisions between DMN files

Edson Tirelli (JIRA) issues at jboss.org
Mon Feb 5 08:56:01 EST 2018


    [ https://issues.jboss.org/browse/DROOLS-1663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13528460#comment-13528460 ] 

Edson Tirelli edited comment on DROOLS-1663 at 2/5/18 8:55 AM:
---------------------------------------------------------------

[~fedor.gavrilov] , start by reading the spec, section 6.3.3, page 41.

Then, lets implement the simplest case first:

1. create a model with a simple BKM: e.g., create a "summation" BKM, that takes two numbers "a" and "b" as parameters, and returns the result of adding them up.
2. create a second model that has two input data nodes ("a" and "b") and a decision "adding a and b", with the literal expression expression:

lib.summation( a, b )

3. on this second model, add an import clausule like the following:

<import xmlns:kie="http://www.drools.org/kie/dmn/1.1"
             importType="http://www.omg.org/spec/DMN/20151101/dmn.xsd" 
             namespace="<insert here the namespace of model 1 above>" 
             kie:name="lib" />

Please note that the attribute "name" is missing in the DMN 1.1 spec, but it is required (it was added already in 1.2). So for now, we need to use a custom attribute like the above. We already have a similar case of the FunctionDefinition attribute "kind", so you can look in here for an example of how to do it:

https://github.com/kiegroup/drools/blob/master/kie-dmn/kie-dmn-model/src/main/java/org/kie/dmn/model/v1_1/FunctionDefinition.java#L24-L46

4. create a test case that builds the two files into a single kjar and executes. It must compile and run fine.

This is the simplest case, once this is working we will need to make it work with item definitions, decisions, and all other nodes in the imported model. After that we need to look into importing other types of files like XML and XSD.





was (Author: tirelli):
[~fedor.gavrilov] 

[~fedor.gavrilov] , start by reading the spec, section 6.3.3, page 41.

Then, lets implement the simplest case first:

1. create a model with a simple BKM: e.g., create a "summation" BKM, that takes two numbers "a" and "b" as parameters, and returns the result of adding them up.
2. create a second model that has two input data nodes ("a" and "b") and a decision "adding a and b", with the literal expression expression:

lib.summation( a, b )

3. on this second model, add an import clausule like the following:

<import xmlns:kie="http://www.drools.org/kie/dmn/1.1"
             importType="http://www.omg.org/spec/DMN/20151101/dmn.xsd" 
             namespace="<insert here the namespace of model 1 above>" 
             kie:name="lib" />

Please note that the attribute "name" is missing in the DMN 1.1 spec, but it is required (it was added already in 1.2). So for now, we need to use a custom attribute like the above. We already have a similar case of the FunctionDefinition attribute "kind", so you can look in here for an example of how to do it:

https://github.com/kiegroup/drools/blob/master/kie-dmn/kie-dmn-model/src/main/java/org/kie/dmn/model/v1_1/FunctionDefinition.java#L24-L46

4. create a test case that builds the two files into a single kjar and executes. It must compile and run fine.

This is the simplest case, once this is working we will need to make it work with item definitions, decisions, and all other nodes in the imported model. After that we need to look into importing other types of files like XML and XSD.




> Kie DMN doesn't support IMPORT decisions between DMN files
> ----------------------------------------------------------
>
>                 Key: DROOLS-1663
>                 URL: https://issues.jboss.org/browse/DROOLS-1663
>             Project: Drools
>          Issue Type: Enhancement
>          Components: dmn engine
>            Reporter: Stylianos Koussouris
>            Assignee: Fedor Gavrilov
>         Attachments: IMG_2197.jpg, IMG_2198.jpg, IMG_2199.jpg
>
>
> DMN Spec 1.1
> Page 40.
> import: Import [*] This attribute is used to import externally defined elements and
> make them available for use by elements in this Definitions.
> Section 6.3.3 Import metamodel
> The aim here is to be able to import one Decision defined in a separate DMN into another where it is used as a supporting decision and is referenced (RequiredDecision)



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list