Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Deletion of namespaces with getXMLNSPrefixMap()
Deletion of namespaces with getXMLNSPrefixMap() [message #1419167] Mon, 08 September 2014 07:37 Go to next message
Peter Gernold is currently offline Peter GernoldFriend
Messages: 11
Registered: January 2014
Junior Member
We have implemented a logic to identify obsolete namespaces in our BPMN2 document and trigger the deletion of the namespaces by calling method getXMLNSPrefixMap().remove(...) on documentRoot at save time.
Example: A dataInput refers to a itemDefinition, which refers by structureRef to a namespace. If the dataInput is deleted, we check, if the itemDefinition is referred by another element and in case not the deletion of the itemDefinition, the import and the namespace is triggered.
We have executed several manual tests and one is reproducable failing. The tests are:
1.) Delete dataInput in modeler, save your change, close the modeler, open the modeler, delete another dataInput and save your changes.
Result (is OK): Both dataInputs, the itemDefinitions, the imports and namespaces are deleted
2.) Delete dataInput in modeler, delete another dataInput and save your changes.
Result (is OK): Both dataInputs, the itemDefinitions, the imports and namespaces are deleted
3.) Delete dataInput in modeler, save your change, delete another dataInput and save your changes.
Result (is NOT OK): Both dataInputs, the itemDefinitions and the imports are deleted. Only the namespace of the first dataInput is deleted, but not the ones of the second dataInput.
Remark to 3.): Via debugger we have verified that the deletion of the namespace for the second dataInput is triggered by calling getXMLNSPrefixMap().remove(...) and the namespace is really removed from the map, but the resulting BPMN2 file contains still the namespace.

Any idea how to solve this issue. Thanks
Peter
Re: Deletion of namespaces with getXMLNSPrefixMap() [message #1427019 is a reply to message #1419167] Fri, 19 September 2014 15:21 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Peter,

It all depends on WHEN you are calling remove() at save time. This is some very intense code and I had a hard time figuring this stuff out myself. I'd suggest you try to step through the EMF serializer to find out where those namespaces are being added to the NS map after you remove them.

Bob
Re: Deletion of namespaces with getXMLNSPrefixMap() [message #1439457 is a reply to message #1427019] Tue, 07 October 2014 07:17 Go to previous message
Peter Gernold is currently offline Peter GernoldFriend
Messages: 11
Registered: January 2014
Junior Member
Hi Bob,
I fear I need additional help.
I have had a look at org.eclipse.emf.ecore.xmi.impl class XMLSaveImpl. In method addAttributeNS the namespace is created. This happens, because the helper object in method addNamespaceDeclarations contains in packages the namespace, which has been deleted. The package list is taken from the XMLHelper of package org.eclipse.bpmn2.modeler.core.model, class Bpmn2ModelerResourceImpl.
If I set in the debugger nsPrefix and nsUri to null at the second save of example 3. , then the namespace will not be created.
What needs to be done that the xmlHelper does not contain the deleted package?

For your information: The namespaces in this.content.get(0) in class Bpmn2ModelerResourceImpl are the correct ones in all my tests.

Thanks again for your help
Peter
Previous Topic:Extending model, "Not a valid identifier" error
Next Topic:Custom Task (icon not being replaced)
Goto Forum:
  


Current Time: Mon May 28 01:43:51 GMT 2018

Powered by FUDForum. Page generated in 0.02469 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top