Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Persistence problem with optional assignment rules(Optional assigments are missing)
Persistence problem with optional assignment rules [message #698310] Tue, 19 July 2011 08:53 Go to next message
Balazs Varnai is currently offline Balazs VarnaiFriend
Messages: 21
Registered: June 2011
Junior Member
Hi,

I populate a xtext model using the generated EMF factory, the resource implementation retrieved correctly via the extension registry.

Given an optional assignment rule 'members', these are not persisted. Is there a way to force optional items?

Structure:
	'struct' name=ID '{'
	members+=Member*
	'}';
Re: Persistence problem with optional assignment rules [message #698314 is a reply to message #698310] Tue, 19 July 2011 08:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13615
Registered: July 2009
Senior Member
Hi, if the members are not optional why don't use

Structure:
	'struct' name=ID '{'
	members+=Member+
	'}';



Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Persistence problem with optional assignment rules [message #698315 is a reply to message #698310] Tue, 19 July 2011 08:58 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

have you checked that the members are really contained in the structure? Which version of Xtext do you use? What does the code for the model population and serialisation look like?

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Persistence problem with optional assignment rules [message #698323 is a reply to message #698315] Tue, 19 July 2011 09:11 Go to previous messageGo to next message
Balazs Varnai is currently offline Balazs VarnaiFriend
Messages: 21
Registered: June 2011
Junior Member
I use Xtext 2.0 and the structure members are populated. I could make it mandatory, but it feels bad. Optional means if it's there, it's there and serialized accordingly.

Member member = Factory.eINSTANCE.createMember();
structure.getMembers().add(member);


It's a containment feature and structure is added to the resource.

getResourceSet().getResources().get(0).save(null);


Resource is org.eclipse.xtext.resource.XtextResource as expected.

Thanks!

[Updated on: Tue, 19 July 2011 09:16]

Report message to a moderator

Re: Persistence problem with optional assignment rules [message #698327 is a reply to message #698323] Tue, 19 July 2011 09:21 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

do you use the experimental serialiser feature (not fully implemented yet) or the "old" ParseTreeConstructorFragment?


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Persistence problem with optional assignment rules [message #698331 is a reply to message #698327] Tue, 19 July 2011 09:28 Go to previous message
Balazs Varnai is currently offline Balazs VarnaiFriend
Messages: 21
Registered: June 2011
Junior Member
Hi,

I guess the new one Rolling Eyes

// Serializer 2.0
fragment = serializer.SerializerFragment {}
Previous Topic:Package declaration help
Next Topic:Problem with unorder group
Goto Forum:
  


Current Time: Wed Sep 30 10:48:04 GMT 2020

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

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

Back to the top