Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » select command in .ETL(access to an element of one model using ETL)
select command in .ETL [message #1165976] Fri, 01 November 2013 17:39 Go to next message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
Hi my friends
I created one "emf model" from one ".ecre" file. I want to access the instance of one Eclass in "emf model" using ".etl" code. for example, my ".ecore" file is similar to :
index.php/fa/16643/0/

and my model is:
index.php/fa/16642/0/

I want to access "file a" in my model. so in ".etl" code i write:
var file := fileSystem.select(i | i.name= file).first();

but i get this error in run of launch file:
"Called feature name on undefined object"

can any one help me for this problem? what should i write instead of this command?
  • Attachment: model.png
    (Size: 3.59KB, Downloaded 460 times)
  • Attachment: metamodel.png
    (Size: 16.66KB, Downloaded 481 times)

[Updated on: Fri, 01 November 2013 17:43]

Report message to a moderator

Re: select command in .ETL [message #1165998 is a reply to message #1165976] Fri, 01 November 2013 17:59 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 Masha,

Filesystem.all.first().files.select(i | i.name = "a").first() should do the trick.

Cheers,
Dimitris

[Updated on: Fri, 01 November 2013 17:59]

Report message to a moderator

Re: select command in .ETL [message #1166240 is a reply to message #1165998] Fri, 01 November 2013 21:51 Go to previous messageGo to next message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
Thanks Dimitis,
>Filesystem.all.first().files.select(i | i.name = "a").first() should do the trick.
This command just works for access to the instance with name of "a" but I want access to first instance of file from fileSystem in any model. in other word, I must get all instances of fileSystems, and then I should select first file instance from them. in my case,always there is one fileSystem in any model.
Re: select command in .ETL [message #1166247 is a reply to message #1166240] Fri, 01 November 2013 21:58 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 Masha,

Then, what you probably need is Filesystem.all.first().files.first()

Cheers,
Dimitris
Re: select command in .ETL [message #1167583 is a reply to message #1166247] Sat, 02 November 2013 19:40 Go to previous messageGo to next message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
Thanks,
I tried this, but I receive this error: "'file' not found in object"!
Re: select command in .ETL [message #1167594 is a reply to message #1167583] Sat, 02 November 2013 19:49 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 Masha,

I suspect that you mistyped something since there's no token "file" in the solution I suggested:

Filesystem.all.first().files.first().println();

If that's not the case, could you please put together a minimal example [1] I can use to reproduce this?

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/articles/minimal-examples/
Re: select command in .ETL [message #1167731 is a reply to message #1167594] Sat, 02 November 2013 22:02 Go to previous message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
I'm really thankful.My problem is solved by your guidances:)

[Updated on: Sat, 02 November 2013 22:03]

Report message to a moderator

Previous Topic:Importing problems
Next Topic:[ECL] How to exclude matches / how to run module
Goto Forum:
  


Current Time: Tue Apr 23 10:17:37 GMT 2024

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

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

Back to the top