Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [ETL] Accessing one output of a multiple "to's" transformation
[ETL] Accessing one output of a multiple "to's" transformation [message #660241] Thu, 17 March 2011 14:19 Go to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 242
Registered: October 2009
Location: Mexico
Senior Member

Hello,

I have a transformation rule that has multiple to's:

rule InitialPlace
	transform node : sysmlModel!InitialNode
	to p : hilesB!Place, arc : hilesB!Arc {
		p.name = "InitialNode";
		arc.from_point = node.equivalent("InitialPlaceService");
		arc.to_node = p;
	}


I was wondering if there is a way to access an specific output element of the transformation as in ATL. So when I do:

...
pn.elements.addAll(a.node.collect(n : sysmlModel!InitialNode | n).first().equivalents("InitialPlace"));
...


I could decide to add the places or the arcs.

Thanks,

Horacio


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: [ETL] Accessing one output of a multiple "to's" transformation [message #660422 is a reply to message #660241] Fri, 18 March 2011 11:33 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 Horacio,

I'm not sure I understand your question. Could you please elaborate a bit more?

Cheers,
Dimitris
Re: [ETL] Accessing one output of a multiple "to's" transformation [message #660512 is a reply to message #660422] Fri, 18 March 2011 18:04 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 242
Registered: October 2009
Location: Mexico
Senior Member

Hello Dimitris,

In ATL, when you use the resolveTemp() operation to resolve references to elements transformed by other rules (similar to ETL's equivalent()), if the transformation rule that resolves the reference to the element has mutiple "to's", you can specify the one you actually want to be used. From the ATL manual:

rule Case3_R1 { 
  from 
  i : MM_A!ClassA 
  to 
    o_1 : MM_B!Class1 ( 
   linkToClass2 <- thisModule.resolveTemp(i.linkToClassB, 'o_n') 
  ) 
} 
 
rule Case3_R2 { 
  from 
  in : MM_A!ClassB 
  to 
    o_1 : MM_B!Class3 ( 
   ... 
  ), 
  ... 
    o_n : MM_B!Class2 ( 
   ... 
  ), 
  ... 
} 


In the resolveTemp operation of rule Case3_R1, the reference to "i.linkToClassB" will be provided by the rule Case3_R2. However, that rule has 'n' to's. In the resolveTemp call I can specify that I want the reference to the element result of transformation to o_n. This way I can choose which of the to's I want to be used to solve the reference.

My question is if ETL's equivalent (or equivalents) operation can provide a similar behavior.

Thanks,

Horacio


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: [ETL] Accessing one output of a multiple "to's" transformation [message #661614 is a reply to message #660512] Fri, 25 March 2011 15:06 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 Horacio,

Apologies for the late reply. This seems to have somehow slipped my attention. The equivalents() operation returns a sequence of sequences containing all the target elements that have been produced from the source element on which it's been applied. You can flatten it into a normal sequence using .flatten() and then query the sequence to get the elements you're interested in.

Cheers,
Dimitris
Re: [ETL] Accessing one output of a multiple "to's" transformation [message #661948 is a reply to message #660241] Mon, 28 March 2011 15:06 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 242
Registered: October 2009
Location: Mexico
Senior Member

Hi Dimitris,

Reading other posts I thought the solution might be of this sort. Any way I can add a request for an ATL like implementation? It just seems "faster" that do an additional select.

Regards,

Horacio


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: [ETL] Accessing one output of a multiple "to's" transformation [message #661957 is a reply to message #661948] Mon, 28 March 2011 15:28 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Horacio,

Sure! Please make sure that you attach a fairly complete example together with metamodels and excerpts of the expected syntax and how you'd expect it to work so that we can have a test-case to validate the implementation against.

Cheers,
Dimitris
Previous Topic:[Patch] Exclude /org.eclipse.epsilon.workflow/bin from runtime Eclipse application classpath
Next Topic:Older Epsilon versions
Goto Forum:
  


Current Time: Fri Apr 19 23:45:22 GMT 2024

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

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

Back to the top