Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » creating multiple targets in HOT
creating multiple targets in HOT [message #1267417] Sun, 09 March 2014 00:58 Go to next message
azadeh jb is currently offline azadeh jbFriend
Messages: 18
Registered: September 2013
Junior Member
Hi,

I'm trying to write a HOT transformation that takes a weaving model as input and should create an ATL transformation as output. In my HOT I have a rule which should create multiple targets (rules) :

rule createMultipleRules{
from
amw : AMW!linkType1
to

atl1 : ATL!CalledRule (
name <- 'ATLrule1',
outPattern <- amw.Target),


atl2 : ATL!CalledRule (
name<-'ATLrule2',
outPattern<-amw.Target)
}

I can run the code without any error but the problem is only first target (atl1) is created and the compiler ignores the second target.
Am I missing something here?

Thanks,
Azadeh
Re: creating multiple targets in HOT [message #1268268 is a reply to message #1267417] Mon, 10 March 2014 09:23 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 523
Registered: July 2009
Senior Member
the second target is actually created but you have to "store" it somewhere.
This rule only link a linkType1 with the atl1 target and the atl2 target is not directly linked.
You either have to use resolveTemp to get to atl2 in another rule or you can link atl2 to something in the imperative section of the createMultipleRules rule.
Re: creating multiple targets in HOT [message #1268493 is a reply to message #1268268] Mon, 10 March 2014 15:19 Go to previous messageGo to next message
azadeh jb is currently offline azadeh jbFriend
Messages: 18
Registered: September 2013
Junior Member
Thanks Sylvain,

Can you please tell me how to "store" the second target? Because the second target (atl2) is supposed to create a rule in the output for me, so accessing it from resolveTemp or imperative part will not help me.
Another question is that why we don't need to link all targets in normal atl transformation but we have to do it in HOT.

Regards,
Azadeh
Re: creating multiple targets in HOT [message #1269247 is a reply to message #1268493] Tue, 11 March 2014 15:32 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 523
Registered: July 2009
Senior Member
rules are stored in a module (aka transformation).
You probably have another rule that transforms something into a module or a transformation and then the linkTypes are referenced.
They will be transformed to rules so everything is working well.
Except that a linkType is transformed only to one other thing by default : the first target element ('atl1' here).
So as I said, you have to also add 'atl2' in the module, either by using resolveTemp or using the imperative part.

At the moment the second rule is created but is useless because it's not stored in a module.
Re: creating multiple targets in HOT [message #1270127 is a reply to message #1269247] Wed, 12 March 2014 14:22 Go to previous message
azadeh jb is currently offline azadeh jbFriend
Messages: 18
Registered: September 2013
Junior Member
Thanks again Sylvain. I'll try it this way.

Previous Topic:'allInstances()' also returns subtypes
Next Topic:[EMFTVM] Inheritance in lazy rule
Goto Forum:
  


Current Time: Sat Dec 20 03:02:28 GMT 2014

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

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