[jboss-jira] [JBoss JIRA] (DROOLS-3517) [DMN Designer] Data Types - Constraints - Constraint property

Matteo Mortari (Jira) issues at jboss.org
Fri Jan 18 09:35:01 EST 2019


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

Matteo Mortari edited comment on DROOLS-3517 at 1/18/19 9:34 AM:
-----------------------------------------------------------------

understood thank [~karreiro].

Original pointer is valid for a custom QName: https://github.com/kiegroup/drools/blob/7857f1886a569530e8a77f18540b6773ac97c094/kie-dmn/kie-dmn-model/src/main/java/org/kie/dmn/model/v1_1/TFunctionDefinition.java#L31

but additionally, please don't modify kie-dmn-model, it should be enough as long as the `kie` namespace is managed on the root Definitions node to just add its valorization calling "getAdditionalAttributes()" and using that QName and the valorization with the String you want (must be a string as this is XML persisted)


was (Author: tari_manga):
understood thank [~karreiro].

Original pointer is valid for a custom QName: If the custom attributes are really, really, needed, this must be specified both on kie-wb but also inside the kie-dmn-model (which I would avoid due to the wide impact) similarly to what we did, in the past, here: https://github.com/kiegroup/drools/blob/7857f1886a569530e8a77f18540b6773ac97c094/kie-dmn/kie-dmn-model/src/main/java/org/kie/dmn/model/v1_1/TFunctionDefinition.java#L31

but additionally, please don't modify kie-dmn-model, it should be enough as long as the `kie` namespace is managed on the root Definitions node to just add its valorization calling "getAdditionalAttributes()" and using that QName and the valorization with the String you want (must be a string as this is XML persisted)

> [DMN Designer] Data Types - Constraints - Constraint property
> -------------------------------------------------------------
>
>                 Key: DROOLS-3517
>                 URL: https://issues.jboss.org/browse/DROOLS-3517
>             Project: Drools
>          Issue Type: Task
>          Components: DMN Editor
>            Reporter: Guilherme Carreiro
>            Assignee: Daniel José dos Santos
>            Priority: Major
>              Labels: drools-tools
>
> Currently the _Constraint dialog_ infers the {{Constraint type}} based on the value.
> - A new property ({{kie:constraintType}}) needs to be added in the in {{itemDefinition.allowedValues}} element. See how the DMN file will look like:
> {noformat}
> <?xml version="1.0" ?>
> <dmn:definitions ...>
>   <dmn:itemDefinition id="_C9B6988F-0302" name="tNum" isCollection="false">
>     <dmn:typeRef>number</dmn:typeRef>
>     <dmn:allowedValues kie:constraintType="range" id="_F7A1878D-A464">
>       <dmn:text>(1..200)</dmn:text>
>     </dmn:allowedValues>
>   </dmn:itemDefinition>
>   <dmndi:DMNDI>
>     <dmndi:DMNDiagram></dmndi:DMNDiagram>
>   </dmndi:DMNDI>
> </dmn:definitions>
> {noformat}
> - Update the {{DataType}} class with the new property (from {{ItemDefinition.allowedValues}});
> - Use the new property in the {{DataTypeConstraintModal}} class to load the right component (instead of inferring the type).



--
This message was sent by Atlassian Jira
(v7.12.1#712002)



More information about the jboss-jira mailing list