Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » The method of createInstances()
The method of createInstances() [message #1405193] Wed, 06 August 2014 20:18 Go to next message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
Hi,
I have a model that contains containment references. I want to manipulate it and omit containment references. In my solution, I need to create one instance from each element. For example: (Model is reference to my model)
for (element in Model!allInstances())
{
element.type().createInstance();
...
}

I get error for this code because I must create an instance from one model element type (Emfmodel). Can any one help me for alternative solution?
Thanks:)
Re: The method of createInstances() [message #1405379 is a reply to message #1405193] Thu, 07 August 2014 08:10 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Mahsa,

Model.createInstance(element.type().name) should do the trick.

Cheers,
Dimitris
Re: The method of createInstances() [message #1405407 is a reply to message #1405379] Thu, 07 August 2014 09:32 Go to previous message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
Hi Dimitris,
Your suggestion is perfect. I'm very grateful to you.
Previous Topic:EOL: Access to UML Papyrus Stereotypes and their tagged value through EOL
Next Topic:Using the one variable instead of id name of one model in Epsilon codes
Goto Forum:
  


Current Time: Thu Apr 25 12:32:27 GMT 2024

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

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

Back to the top