Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » save options(Which save options to get exactly same output as modeler programatically)
save options [message #1438778] Mon, 06 October 2014 13:25 Go to next message
Martin Jonsson is currently offline Martin JonssonFriend
Messages: 21
Registered: March 2013
Junior Member
Hello Rob.

I'm trying to save a programatically created bpmn2 model exactly like the modeler generates the file.

The easy solution would be to use the Bpmn2ModelerResourceFactory but in a stand alone mode (that is similar to the modelreader example) it requires too many modeler dependencies to be practical.

Therefore I have been looking into the save options of a emf model and got completely lost.

First: all bpmn elements that the bpmn2 model does not recognize gets save with prefix of my target namespace. Example:
<bpmn2:itemDefinition id="ItemDefinition_1" structureRef="sapprop:sflight"/> with sapprop being my target namespace in lowercase. I found a save option that prevented this and then lost it again in all my crazy testing..

Second: the structureRef above gets saved with full document reference whereas in the modeler resource implementation a custom xml handler is used. I wish to use that handler is stand alone, ie for save option OPTION_URI_HANDLER.

So could I be guided out of the forest to generate programatically the same output as the modeler produces?

Many thanks!
Re: save options [message #1440588 is a reply to message #1438778] Wed, 08 October 2014 15:02 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hmm, the only thing I can suggest is to look at the Bpmn2ModelerResourceImpl class. I have found that, for me, these XML OPTION_ things are a matter of trial and error and their behavior can only be fully understood by debugging deep into the EMF code Sad

Also, if you have defined a default namespace (i.e. <definitions xmlns=""...>) it will affect whether NS prefixes are generated or not.

Sorry I couldn't be more help, but a lot of this EMF parsing and serializing is "black magic" to me Wink

Previous Topic:Multiple target runtimes per project
Next Topic: source code for the BPMN2 modeler editor
Goto Forum:

Current Time: Tue Feb 18 08:15:53 GMT 2020

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

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

Back to the top