Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » problem with the model file
problem with the model file [message #419377] Wed, 21 May 2008 09:14 Go to next message
Alexandre Jaquet is currently offline Alexandre JaquetFriend
Messages: 38
Registered: July 2009
Member
Hi,

I'm a bit confused with a problem I got, I've some EClass called
Message, MessageGroup and I want to append some
Message entities to my MessageGroup.

When I execute the following code

Message message = getMessageFactory().createMessage();
message.setValue(element.getMessage(locale));
group.getMessages().add(message);

message is correctly added to the MessageGroup but If I open the message
file with a text editor or the emf editor
the message is not saved in the model

What can be the cause ?

Thanks in advance
Re: problem with the model file [message #419388 is a reply to message #419377] Wed, 21 May 2008 21:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Alexandre,

Is the MessageGroup.messages reference a containment reference?


Alexandre Jaquet wrote:
> Hi,
>
> I'm a bit confused with a problem I got, I've some EClass called
> Message, MessageGroup and I want to append some
> Message entities to my MessageGroup.
>
> When I execute the following code
>
> Message message = getMessageFactory().createMessage();
> message.setValue(element.getMessage(locale));
> group.getMessages().add(message);
>
> message is correctly added to the MessageGroup but If I open the
> message file with a text editor or the emf editor
> the message is not saved in the model
>
> What can be the cause ?
>
> Thanks in advance


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: problem with the model file [message #419404 is a reply to message #419388] Thu, 22 May 2008 06:22 Go to previous messageGo to next message
Alexandre Jaquet is currently offline Alexandre JaquetFriend
Messages: 38
Registered: July 2009
Member
Hi Ed,

There is a relation between MessageGroup and Message called messages but
this is not a containment reference.
Re: problem with the model file [message #419431 is a reply to message #419404] Thu, 22 May 2008 11:43 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Alexandre,

The Message instance will need to be contained by some containment
reference or directly in the contents of the resource to be serialized
(and only XMI resources support multiple roots). I.e., if
message.eResource() == null, it can't be serialized.


Alexandre Jaquet wrote:
> Hi Ed,
>
> There is a relation between MessageGroup and Message called messages
> but this is not a containment reference.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Sharing EMF instances across an application?
Next Topic:problem with dynamic templates faq
Goto Forum:
  


Current Time: Fri Apr 26 19:51:59 GMT 2024

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

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

Back to the top