Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] find a target element by resolveTemp
[ATL] find a target element by resolveTemp [message #31548] Fri, 13 April 2007 17:38 Go to next message
Eclipse UserFriend
Originally posted by: benoit.combemale.gmail.com

Hi all,

It is possible to find in a "matched rule" (A) a target model
element (by resolveTemp) created by a "called rule" called by
another "matched rule" (B) ?

thx,
Ben.

--
Benoît COMBEMALE
Re: [ATL] find a target element by resolveTemp [message #31584 is a reply to message #31548] Fri, 13 April 2007 18:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikael.barbero.gmail.com

Hi Ben,

No, it is not possible as called rule are not matched !! You must use
matched rule or lazy rule (restrictions exist in this case).

Regards,
Mikael

Benoit Combemale wrote:
> Hi all,
>
> It is possible to find in a "matched rule" (A) a target model
> element (by resolveTemp) created by a "called rule" called by
> another "matched rule" (B) ?
>
> thx,
> Ben.
>



--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
Re: [ATL] find a target element by resolveTemp [message #31618 is a reply to message #31584] Sat, 14 April 2007 13:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benoit.combemale.gmail.com

Hi Mikael,

Thx you for your response. In fact, my concrete problem is the fallowing :

rule A2B {
from MMa!A
to
..... -- target elements creation for all A
do {
if ( A.isXXX ) {
thisModule.myCalledRule(A) -- target elements creation when A is XXX
}
}
}

And now, i would like to find target elements created when A is XXX in another
rule.

Indeed, i can use two matched rule (A_WhichIsXXX2B and A_WhichIsNotXXX2B) but
i repeat all the common part :(

have you got some solutions ?

Regards,
ben.

On Fri, 13 Apr 2007 20:56:23 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
> Hi Ben,
>
> No, it is not possible as called rule are not matched !! You must use
> matched rule or lazy rule (restrictions exist in this case).
>
> Regards,
> Mikael
>
> Benoit Combemale wrote:
>> Hi all,
>>
>> It is possible to find in a "matched rule" (A) a target model
>> element (by resolveTemp) created by a "called rule" called by
>> another "matched rule" (B) ?
>>
>> thx,
>> Ben.
>>
>
>
>


--
Benoît COMBEMALE
Re: [ATL] find a target element by resolveTemp [message #31653 is a reply to message #31618] Sat, 14 April 2007 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benoit.combemale.gmail.com

Thx you for your help Mikael.
I resolve my problem by the use of rule inheritance.

Regards,
Ben.

On Sat, 14 Apr 2007 15:10:06 +0200, Benoit Combemale <benoit.combemale@gmail.com> wrote :
> Hi Mikael,
>
> Thx you for your response. In fact, my concrete problem is the fallowing :
>
> rule A2B {
> from MMa!A
> to
> ..... -- target elements creation for all A
> do {
> if ( A.isXXX ) {
> thisModule.myCalledRule(A) -- target elements creation when A is XXX
> }
> }
> }
>
> And now, i would like to find target elements created when A is XXX in another
> rule.
>
> Indeed, i can use two matched rule (A_WhichIsXXX2B and A_WhichIsNotXXX2B) but
> i repeat all the common part :(
>
> have you got some solutions ?
>
> Regards,
> ben.
>
> On Fri, 13 Apr 2007 20:56:23 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
>> Hi Ben,
>>
>> No, it is not possible as called rule are not matched !! You must use
>> matched rule or lazy rule (restrictions exist in this case).
>>
>> Regards,
>> Mikael
>>
>> Benoit Combemale wrote:
>>> Hi all,
>>>
>>> It is possible to find in a "matched rule" (A) a target model
>>> element (by resolveTemp) created by a "called rule" called by
>>> another "matched rule" (B) ?
>>>
>>> thx,
>>> Ben.
>>>
>>
>>
>>
>
>


--
Benoît COMBEMALE
Re: [ATL] find a target element by resolveTemp [message #32215 is a reply to message #31584] Tue, 17 April 2007 06:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benoit.combemale.gmail.com

which are the restrictions on resolveTemp when the target element
is created by one lazy rule ?

Thx
ben.

On Fri, 13 Apr 2007 20:56:23 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
> Hi Ben,
>
> No, it is not possible as called rule are not matched !! You must use
> matched rule or lazy rule (restrictions exist in this case).
>
> Regards,
> Mikael
>
> Benoit Combemale wrote:
>> Hi all,
>>
>> It is possible to find in a "matched rule" (A) a target model
>> element (by resolveTemp) created by a "called rule" called by
>> another "matched rule" (B) ?
>>
>> thx,
>> Ben.
>>
>
>
>


--
Benoît COMBEMALE
Re: [ATL] find a target element by resolveTemp [message #32250 is a reply to message #32215] Tue, 17 April 2007 07:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikael.barbero.gmail.com

Hi Benoit,

I'm glad to see that you solved your problem.

There are restrictions when you have multiple lazy rules matching the
same model element: ATL is not able to determine which one has to be
selected.

Regards,
Mikael

Benoit Combemale wrote:
> which are the restrictions on resolveTemp when the target element
> is created by one lazy rule ?
>
> Thx
> ben.
>
> On Fri, 13 Apr 2007 20:56:23 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
>> Hi Ben,
>>
>> No, it is not possible as called rule are not matched !! You must use
>> matched rule or lazy rule (restrictions exist in this case).
>>
>> Regards,
>> Mikael
>>
>> Benoit Combemale wrote:
>>> Hi all,
>>>
>>> It is possible to find in a "matched rule" (A) a target model
>>> element (by resolveTemp) created by a "called rule" called by
>>> another "matched rule" (B) ?
>>>
>>> thx,
>>> Ben.
>>>
>>
>>
>
>



--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
Re: [ATL] find a target element by resolveTemp [message #32533 is a reply to message #32250] Wed, 18 April 2007 13:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benoit.combemale.gmail.com

Hi Mikael,

In my work, I've one lazy rule called by one matched rule (A).
In another matched rule (B), I try to find the target element created
by the lazy rule.

I've an execution error :
"message: ERROR: could not find operation including on Module
having supertypes: [OclAny]"

Have you got an example with a lazy rule called by a first matched rule
and a second matched rule which use resolveTemp to find the target element
created by the lazy rule ?

Regards,
Ben.

On Tue, 17 Apr 2007 09:57:30 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
> Hi Benoit,
>
> I'm glad to see that you solved your problem.
>
> There are restrictions when you have multiple lazy rules matching the
> same model element: ATL is not able to determine which one has to be
> selected.
>
> Regards,
> Mikael
>
> Benoit Combemale wrote:
>> which are the restrictions on resolveTemp when the target element
>> is created by one lazy rule ?
>>
>> Thx
>> ben.
>>
>> On Fri, 13 Apr 2007 20:56:23 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
>>> Hi Ben,
>>>
>>> No, it is not possible as called rule are not matched !! You must use
>>> matched rule or lazy rule (restrictions exist in this case).
>>>
>>> Regards,
>>> Mikael
>>>
>>> Benoit Combemale wrote:
>>>> Hi all,
>>>>
>>>> It is possible to find in a "matched rule" (A) a target model
>>>> element (by resolveTemp) created by a "called rule" called by
>>>> another "matched rule" (B) ?
>>>>
>>>> thx,
>>>> Ben.
>>>>
>>>
>>>
>>
>>
>
>
>


--
Benoît COMBEMALE
Re: [ATL] find a target element by resolveTemp [message #34709 is a reply to message #32533] Fri, 27 April 2007 15:07 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello Benoit,

It is possible that resolveTemp does not always work correctly with lazy
rules, I will have to look into this.
However, there is a relatively simple way to make this work: splitting
the lazy rule (see example below).

If you have something like:

rule A {
from
s : MMa!A
to
t : MMb!A (
b <- thisModule.B(s.b),

-- may not work, and apparently does not
-- work in your case
c <- thisModule.resolveTemp(s.b, 't2')
)
}

-- Note that referring to several target elements of a lazy rule
-- mostly makes sense when this rule is *unique*, otherwise it would
-- mean invoking the rule once again.
unique lazy rule B {
from
s : MMa!B
to
t : MMb!B (
c <- t2
),
t2 : MMb!C
}


You may rewrite it into:


rule A {
from
s : MMa!A
to
t : MMb!A (
b <- thisModule.B_1(s.b),
c <- thisModule.B_2(s.b)
)
}

unique lazy rule B_1 { -- or B2B
from
s : MMa!B
to
t : MMb!B (
c <- thisModule.B_2(s)
)
}

unique lazy rule B_2 { -- or B2C
from
s : MMa!B
to
t : MMb!C
}


Regards,

Frédéric Jouault


Benoit Combemale wrote:
> Hi Mikael,
>
> In my work, I've one lazy rule called by one matched rule (A).
> In another matched rule (B), I try to find the target element created
> by the lazy rule.
>
> I've an execution error :
> "message: ERROR: could not find operation including on Module
> having supertypes: [OclAny]"
>
> Have you got an example with a lazy rule called by a first matched rule
> and a second matched rule which use resolveTemp to find the target element
> created by the lazy rule ?
>
> Regards,
> Ben.
>
> On Tue, 17 Apr 2007 09:57:30 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
>> Hi Benoit,
>>
>> I'm glad to see that you solved your problem.
>>
>> There are restrictions when you have multiple lazy rules matching the
>> same model element: ATL is not able to determine which one has to be
>> selected.
>>
>> Regards,
>> Mikael
>>
>> Benoit Combemale wrote:
>>> which are the restrictions on resolveTemp when the target element
>>> is created by one lazy rule ?
>>>
>>> Thx
>>> ben.
>>>
>>> On Fri, 13 Apr 2007 20:56:23 +0200, Mikaël Barbero <mikael.barbero@gmail.com> wrote :
>>>> Hi Ben,
>>>>
>>>> No, it is not possible as called rule are not matched !! You must use
>>>> matched rule or lazy rule (restrictions exist in this case).
>>>>
>>>> Regards,
>>>> Mikael
>>>>
>>>> Benoit Combemale wrote:
>>>>> Hi all,
>>>>>
>>>>> It is possible to find in a "matched rule" (A) a target model
>>>>> element (by resolveTemp) created by a "called rule" called by
>>>>> another "matched rule" (B) ?
>>>>>
>>>>> thx,
>>>>> Ben.
>>>>>
>>>>
>>>
>>
>>
>
>
Previous Topic:[ATL] problem with generating Ecore DataTypes
Next Topic:[ATL] need to do a calcul one Time
Goto Forum:
  


Current Time: Fri Jan 22 13:51:52 GMT 2021

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

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

Back to the top