Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Unique lazy rules with multiple arguments
[ATL] Unique lazy rules with multiple arguments [message #510783] Thu, 28 January 2010 15:51 Go to next message
Marcel  is currently offline Marcel Friend
Messages: 54
Registered: July 2009
Member
Hello,

I have a source model in which a class (with a statemachine) can be instantiated multiple times as an object.
In the target model code has to be generated for each of the objects.

I do this using unique lazy rules with two arguments:
unique lazy rule Vertex2If_Stmnt{
  from v_in : slco!Vertex,
       o_in : slco!Object
		
  to	b_out: promela!block_stmnt(..)
}


For every Vertex/Object pair this rule is called. For example, for one vertex the rule may be called three times for different objects:
Vertex1/Object1
Vertex1/Object2
Vertex1/Object3

I expect that target elements are generated for every unique pair of Vertex/Object, so three in this example.
This is, however, not the case. Target elements are generated only for one Vertex/Object pair.
It looks like ATL only looks at the Vertex in this example, since this element is the same with every call to the unique lazy rule.

Am I doing something wrong here?


At first I tried not to use unique lazy rules, but just a resolveTemp() operation. However, I was unable to use resolveTemp() on a lazy rule with multiple source elements.
If someone knows how to do that, that would also be of help.

Regards,

Marcel

Re: [ATL] Unique lazy rules with multiple arguments [message #510821 is a reply to message #510783] Thu, 28 January 2010 18:08 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Sadly, only the first variable is taken into account for a unique lazy rule. To solve your problem you can use as first variable a useless String built from properties from the 2 variables so that you can still use a unique lazy rule.
Re: [ATL] Unique lazy rules with multiple arguments [message #510867 is a reply to message #510821] Thu, 28 January 2010 21:42 Go to previous messageGo to next message
Marcel  is currently offline Marcel Friend
Messages: 54
Registered: July 2009
Member
I could also make a tuple of the two model elements.
Would that solve my problem?
Re: [ATL] Unique lazy rules with multiple arguments [message #510941 is a reply to message #510821] Fri, 29 January 2010 09:18 Go to previous messageGo to next message
Marcel  is currently offline Marcel Friend
Messages: 54
Registered: July 2009
Member
I fixed it using the solution you suggested.
It works, but I must say I don't like that I have to do it this way.

Thanks for your help!

[Updated on: Fri, 29 January 2010 09:19]

Report message to a moderator

Re: [ATL] Unique lazy rules with multiple arguments [message #511475 is a reply to message #510941] Mon, 01 February 2010 16:49 Go to previous message
Alfons Laarman is currently offline Alfons LaarmanFriend
Messages: 35
Registered: July 2009
Member
Did you try the Tuple approach you suggested?
My guess would be that it works.


Alfons

On 1/29/10 10:18 AM, in article hju956$kr0$1@build.eclipse.org, "Marcel"
<M.F.v.Amstel@tue.nl> wrote:

> I fixed it using the solution you suggested.
> It works, but I must say I don't like it.
Previous Topic:[QVTo] Exceptions and warnings
Next Topic:Refining Execution Mode
Goto Forum:
  


Current Time: Fri Apr 19 01:37:54 GMT 2024

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

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

Back to the top