[jboss-jira] [JBoss JIRA] (DROOLS-2372) [DMN Editor] Marshalling/unmarshalling of QNames is broken
Matteo Mortari (JIRA)
issues at jboss.org
Mon Mar 12 06:00:00 EDT 2018
[ https://issues.jboss.org/browse/DROOLS-2372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13544387#comment-13544387 ]
Matteo Mortari commented on DROOLS-2372:
----------------------------------------
Sorry do you have a test case demonstrating where the problem occurs, please?
Additionally when you say
{quote}When unmarshalled by the same class the workbench QName becomes "drools:feel" with value (for example) F. {quote}
do you actually mean becomes "drools:kind", am I right ?
There was a similar problem in the past, but I verified with https://github.com/kiegroup/kie-wb-common/blob/c4b7d2d10c4e6ad2af928ecc5087d6282506ea1d/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/DMNMarshallerTest.java#L840 that the roundtrip was performed correctly.
To try fully answer your question, in the case of the "kind" attribute, being not part of the spec at v1.1 but a known issue with the spec, it is rendered as a "drools" namespace attribute.
If you have a test case demonstrating where "is broken" because to be honest the only thing which looks odd is that in the "{http://www.drools.org/kie/dmn/1.1\}kind" is the ending \.
> [DMN Editor] Marshalling/unmarshalling of QNames is broken
> ----------------------------------------------------------
>
> Key: DROOLS-2372
> URL: https://issues.jboss.org/browse/DROOLS-2372
> Project: Drools
> Issue Type: Bug
> Components: DMN Editor
> Reporter: Michael Anstis
> Assignee: Matteo Mortari
>
> The workbench creates QName {{"\{http://www.drools.org/kie/dmn/1.1\}kind"}} for {{FunctionDefinition}}'s {{Kind}} and value (for example) {{F}}. This is marshalled by {{FunctionDefinitionPropertyConverter}} to DMN XML. When unmarshalled by the same class the workbench QName becomes {{"drools:feel"}} with value (for example) {{F}}.
> I don't understand why the prefix/local name substitution on the unmarshalling occurs; nor why the workbench is creating a DMN NameSpace Context entry on the {{FunctionDefinition}} for {{drools:http://www.drools.org/kie/dmn/1.1"}}.. I also don't know whether the prefix/local part was used before [~tari_manga] found the string encoding format of {{"\{http://www.drools.org/kie/dmn/1.1\}kind"}} and the unmarshalling has not been updated?
> I can blindly change {{MarshallingUtils}} to ignore prefix/local part and just use the {{javax.xml.namespace.QName#toString()}} method but it'd be foolhardy doing so without understanding the marshalling/unmarshalling better.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list