Skip to main content



      Home
Home » Modeling » ATL » creating multiple targets in HOT
creating multiple targets in HOT [message #1267417] Sat, 08 March 2014 19:58 Go to next message
Eclipse UserFriend
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 05:23 Go to previous messageGo to next message
Eclipse UserFriend
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 11:19 Go to previous messageGo to next message
Eclipse UserFriend
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 11:32 Go to previous messageGo to next message
Eclipse UserFriend
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 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Thanks again Sylvain. I'll try it this way.

Re: creating multiple targets in HOT [message #1746170 is a reply to message #1270127] Mon, 24 October 2016 08:38 Go to previous message
Eclipse UserFriend
No Message Body

[Updated on: Wed, 26 October 2016 19:20] by Moderator

Previous Topic:creating a chain of transformation without intermediate file serialization
Next Topic:ResolveTemp and Multiple Helpers in HOT
Goto Forum:
  


Current Time: Wed Jul 23 15:32:15 EDT 2025

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

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

Back to the top