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 13:38  |
Eclipse User |
|
|
|
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 #31618 is a reply to message #31584] |
Sat, 14 April 2007 09:10   |
Eclipse User |
|
|
|
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 11:06   |
Eclipse User |
|
|
|
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 #32250 is a reply to message #32215] |
Tue, 17 April 2007 03:57   |
Eclipse User |
|
|
|
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 09:51   |
Eclipse User |
|
|
|
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 11:07  |
Eclipse User |
|
|
|
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.
>>>>>
>>>>
>>>
>>
>>
>
>
|
|
|
Goto Forum:
Current Time: Sat Jun 07 05:19:26 EDT 2025
Powered by FUDForum. Page generated in 0.03522 seconds
|