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: 211
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:

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">
        <ext:style ext:shapeBackground="#8000ff"/>

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

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:
                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?

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

Current Time: Sun Dec 10 07:44:37 GMT 2023

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

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

Back to the top