Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Writing to model
Writing to model [message #152751] Mon, 01 October 2007 10:05 Go to next message
Eclipse UserFriend
Originally posted by: kmcglinn.gmail.com

Hey Guys,

I notice that although I specify a label for my ecore attributes, it seems
that they will not be saved to the xmi file when I save the diagram. Is
there any way to force an xmi attribute to appear in the gmf file?

For example, lets say I have a transition between two nodes with an
attribute "condition"
-------
<containsActivities xsi:type="service:TransformationCondition"
source="//@containsSwimlanes.0/@containsActivities.2"
target="//@containsSwimlanes.0/@containsActivities.1" condition=".."/>
-------

If I had not entered ".." into the model I would not have got:
-------
<containsActivities xsi:type="service:TransformationCondition"
source="//@containsSwimlanes.0/@containsActivities.2"
target="//@containsSwimlanes.0/@containsActivities.1" condition=""/>
-------

But rather
-------
<containsActivities xsi:type="service:TransformationCondition"
source="//@containsSwimlanes.0/@containsActivities.2"
target="//@containsSwimlanes.0/@containsActivities.1"/>
-------

Which crashes my parser...any way to force the attribute to be created,
empty or not?

Thanks,

Guy.
Re: Writing to model [message #152761 is a reply to message #152751] Mon, 01 October 2007 10:09 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Guy,

EMF will only save attributes for which eIsSet is true so generally you
must set the value if you want it to be saved. If you use
XMLResource.OPTION_KEEP_DEFAULT_CONTENT as a save option, then features
with an explicit non-null default will serialize that default.


Guy Incognito wrote:
> Hey Guys,
>
> I notice that although I specify a label for my ecore attributes, it
> seems that they will not be saved to the xmi file when I save the
> diagram. Is there any way to force an xmi attribute to appear in the
> gmf file?
>
> For example, lets say I have a transition between two nodes with an
> attribute "condition"
> -------
> <containsActivities xsi:type="service:TransformationCondition"
> source="//@containsSwimlanes.0/@containsActivities.2"
> target="//@containsSwimlanes.0/@containsActivities.1" condition=".."/>
> -------
>
> If I had not entered ".." into the model I would not have got:
> -------
> <containsActivities xsi:type="service:TransformationCondition"
> source="//@containsSwimlanes.0/@containsActivities.2"
> target="//@containsSwimlanes.0/@containsActivities.1" condition=""/>
> -------
>
> But rather
> -------
> <containsActivities xsi:type="service:TransformationCondition"
> source="//@containsSwimlanes.0/@containsActivities.2"
> target="//@containsSwimlanes.0/@containsActivities.1"/>
> -------
>
> Which crashes my parser...any way to force the attribute to be
> created, empty or not?
>
> Thanks,
>
> Guy.
>
Previous Topic:Reformatted: Re: Deadlocks occur after a TransactionalEditingDomain.runExclusive(...) call was inter
Next Topic:DiagramEditPart HEELP
Goto Forum:
  


Current Time: Tue Jul 22 08:40:57 EDT 2025

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

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

Back to the top