[jboss-jira] [JBoss JIRA] (DROOLS-4144) [DMN Designer] Imported model is broken after saving changes
Michael Anstis (Jira)
issues at jboss.org
Fri Jun 7 06:58:00 EDT 2019
[ https://issues.jboss.org/browse/DROOLS-4144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13743845#comment-13743845 ]
Michael Anstis edited comment on DROOLS-4144 at 6/7/19 6:57 AM:
----------------------------------------------------------------
{{org.kie.workbench.common.dmn.api.factory.AbstractDMNDiagramFactory}} assumes the default XML namespace prefix is _reserved_ for the namespace of the DMN model. This works fine in most circumstances (all circumstances of models authored with our tooling) however in the example files the default XML namespace is used to qualify the DMN model. This is overwritten by {{AbstractDMNDiagramFactory}} when the file is opened. This is wrong.
Furthermore {{org.kie.dmn.backend.marshalling.v1_2.xstream.XStreamMarshaller}} attempts to read the DMN namespace prefix from the NSContext entries where the URI matches the DMN URI. If none is found it assumes it to be an empty {{String}} and adds a default namespace entry to the resulting XML. A match is never found as {{AbstractDMNDiagramFactory}} set the default XML namespace to be the DMN model namespace. Consequentially {{XStreamMarshaller}} writes two default namespaces; one for DMN and one for the DMN model namespace as set by {{AbstractDMNDiagramFactory}}.
Ideally {{AbstractDMNDiagramFactory}} should not assume the default XML namespace is for its exclusive use.
A workaround is to ensure the files being used set the DMN namespace prefix to {{dmn}}.
e.g. {{<definitions xmlns:dmn="http://www.omg.org/spec/DMN/20151101/dmn.xsd" ../>}}
was (Author: manstis):
{{org.kie.workbench.common.dmn.api.factory.AbstractDMNDiagramFactory}} assumes the default XML namespace prefix is _reserved_ for the namespace of the DMN model. This works fine in most circumstances (all circumstances of models authored with our tooling) however in the example files the default XML namespace is used to qualify the DMN model. This is overwritten by {{AbstractDMNDiagramFactory}} when the file is opened. This is wrong.
Furthermore {{org.kie.dmn.backend.marshalling.v1_2.xstream.XStreamMarshaller}} attempts to read the DMN namespace prefix from the NSContext entries where the URI matches the DMN URI. If none is found it assumes it to be an empty {{String}} and adds a default namespace entry to the resulting XML. A match is never found as {{AbstractDMNDiagramFactory}} set the default XML namespace to be the DMN model namespace. Consequentially {{XStreamMarshaller}} writes two default namespaces; one for DMN and one for the DMN model namespace as set by {{AbstractDMNDiagramFactory}}.
Ideally {{AbstractDMNDiagramFactory}} should not assume the default XML namespace is for its exclusive use.
A workaround is to ensure the files being used set the DMN namespace prefix to {{dmn}}.
e.g. {{<definitions xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd" ../>}}
> [DMN Designer] Imported model is broken after saving changes
> ------------------------------------------------------------
>
> Key: DROOLS-4144
> URL: https://issues.jboss.org/browse/DROOLS-4144
> Project: Drools
> Issue Type: Bug
> Components: DMN Editor
> Affects Versions: 7.24.0.Final
> Reporter: Jozef Marko
> Assignee: Daniel José dos Santos
> Priority: Major
> Labels: drools-tools
> Attachments: a-2.dmn, a.dmn, error.log
>
>
> When user imports some dmn model (see the attahced a.dmn and a-2.dmn) then he do some changes and save such imported model. He is unable to reopen such model. There is error in the server log.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list