Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Bpmn2ResourceImpl stores different output than the modeler
Bpmn2ResourceImpl stores different output than the modeler [message #1693214] Wed, 22 April 2015 12:42
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 205
Registered: July 2009
Location: Switzerland
Senior Member
Hi Bob

Since currently I can not use the BPMN2 modeler on the server side, I use the org.eclipse.bpmn2.util.Bpmn2ResourceImpl from the "bpmn2" repository.
I noticed that if I load and store a BPMN2 diagram (designed in the BPMN2Modeler) on the server, I get a different output then my original modeler input.
One point is discussed here: https://www.eclipse.org/forums/index.php/m/1691906/

The next change that I noticed is the style is changed.

This is the original coming from the modeler:
    <bpmn2:task id="Task_1" name="Task 1">
      <bpmn2:extensionElements>
        <ext:style ext:shapeBackground="#8000ff"/>
      </bpmn2:extensionElements>
    </bpmn2:task>


after I store it on the server I get:
    <bpmn2:task id="Task_2" name="Task 1">
      <bpmn2:extensionElements>
        <ext:style xsi:type="tl:anyType" ext:shapeBackground="#8000ff"/>
      </bpmn2:extensionElements>
    </bpmn2:task>


This is bad because loading this back into the modeler, the style is not recognized/applied to the element.
After debugging I found out that this would solve the problem:
	resource.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION, false);
	// OR
	resource.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION, true);


What I don't know is if this will cause other problems since in org.eclipse.bpmn2.util.Bpmn2ResourceFactoryImpl.createResource(URI) the option is set like this:
	result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
                new OnlyContainmentTypeInfo());


I'm suspecting a bug since the original XMLTypeInfo in org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.init(XMLResource, Map<?, ?>) does not save "anyType". Maybe OnlyContainmentTypeInfo should be extended with the default behavior?

	xmlTypeInfo = 
	  new XMLTypeInfo()
	  {
		public boolean shouldSaveType(EClass objectType, EClassifier featureType, EStructuralFeature feature)
		{
		  return objectType != anyType;
		}
		
		public boolean shouldSaveType(EClass objectType, EClass featureType, EStructuralFeature feature)
		{
		  return true;
		}
	  };


What do you think is this a bug? Should I implement the default behavior into the OnlyContainmentTypeInfo?
greets
Flavio


Prozessmanagement und Qualit├Ątsmanagement Software QMS/IMS
https://www.scodi.ch
Previous Topic:One or two runtimes?...
Next Topic:Developer Tutorial : ToolPalettes
Goto Forum:
  


Current Time: Tue Oct 16 22:48:19 GMT 2018

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

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

Back to the top