Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » How to use the collection() method?
How to use the collection() method? [message #1842260] Mon, 14 June 2021 18:41 Go to next message
Thomas Chiang is currently offline Thomas ChiangFriend
Messages: 100
Registered: March 2020
Senior Member
I am trying to create an ETL script and I would like to create simple names for my target generated classes. So I am trying to write the command in the rule like this:

rule m2m
	transform s: Excel!Module
	to c: EMF!System_Level_Impact{
		c.name = "Sys_Lvl_Impact" + collection(EMF::System_Level_Impact).size();
	}


How should I be writing the command to get the collection like I want?

Edit: Is there potentially a way to set a counter in my transformation rule to iterate and count how many times my rule is activated during the transformation?

[Updated on: Mon, 14 June 2021 20:31]

Report message to a moderator

Re: How to use the collection() method? [message #1842266 is a reply to message #1842260] Tue, 15 June 2021 05:00 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Thomas,

Something like the following should do the trick [1].

c.name = "Sys_Lvl_Impact" + EMF!System_Level_Impact.all.indexOf(c);


Best,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/eol/#model-element-types

[Updated on: Mon, 21 June 2021 10:30]

Report message to a moderator

Previous Topic:Mapping of abstract types
Next Topic:Traceability
Goto Forum:
  


Current Time: Thu Apr 25 19:43:07 GMT 2024

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

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

Back to the top