Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » multiple pattern matching with resolveTemp
multiple pattern matching with resolveTemp [message #72625] Fri, 18 January 2008 14:57 Go to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi all,
first, i used a part of the AMW metamodel which the class WLink is declared
as abstract, and ClassConformityR, PropertyEqualityR are two classes which
inherit from WLink :
abstract class WLink {
reference child[0-*] order container : WLink oppositeOf parent;
reference parent : Wlink opposite child;
}
class ClassConformityR extends WLink{
}
class PropertyEqualityR extends WLink{
}

In my ATL transformation i create the matched rules above :

abstract rule ElementMatchingRule
from e1 : UML2!Element,e2 : UML2!Element(e1.match(e2))

to r : AMW!WLink

rule ClassConformityRule extends ElementMatchingRule{

from e1: UML2!Class, e2: UML2!Class(e1.match(e2))

to r : AMW!ClassConformityR}

rule PropertyEqualityRule extends ElementMatchingRule{

from e1: UML2!property, e2: UML2!Property(e1.match(e2))

to r : AMW!PropertyEqualityR (

parent <- thisModule.resolveTemp(e1.class,'r') )}

when i use the resolveTemp function i have an exception , how can i create
the reference parent to the ClassConformityR

Thanks,
Adil

GRAVE: ****** BEGIN Stack Trace

GRAVE: message: ERROR: could not find operation getNamedTargetFromSource on
Void having supertypes: [OclAny]

GRAVE: A.main() : ??#86 null

GRAVE: local variables = {self=UML2Corresp : ASMModule}

GRAVE: local stack = []

GRAVE: A.__exec__() : ??#98 null
Re:[ATL] multiple pattern matching with resolveTemp [message #72640 is a reply to message #72625] Fri, 18 January 2008 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

sorry i miss [ATL],

"Adil Anwar" <adilanwar10@yahoo.fr> a
Re: [ATL] multiple pattern matching with resolveTemp [message #72718 is a reply to message #72640] Fri, 18 January 2008 16:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mddfabro.ilog.fr

Hello,

you should use tuples in the resolveTemp if it refers to rules that have
more than one input pattern.

Your resolveTemp should be similar to the code below:

parent <- thisModule.resolveTemp(
Tuple {
e1 = e1.class,
e2 =
-- here you should put some condition to get the e2 element,
-- for instance:
UML2!Element.allInstances()->select ( e | e1.class.match(e))->first()

} ,'r') )}

Regards,

Marcos.


Adil Anwar wrote:
> sorry i miss [ATL],
>
> "Adil Anwar" <adilanwar10@yahoo.fr> a écrit dans le message de news:
> fmqepe$7fj$1@build.eclipse.org...
>> Hi all,
>> first, i used a part of the AMW metamodel which the class WLink is
>> declared as abstract, and ClassConformityR, PropertyEqualityR are two
>> classes which inherit from WLink :
>> abstract class WLink {
>> reference child[0-*] order container : WLink oppositeOf parent;
>> reference parent : Wlink opposite child;
>> }
>> class ClassConformityR extends WLink{
>> }
>> class PropertyEqualityR extends WLink{
>> }
>>
>> In my ATL transformation i create the matched rules above :
>>
>> abstract rule ElementMatchingRule
>> from e1 : UML2!Element,e2 : UML2!Element(e1.match(e2))
>>
>> to r : AMW!WLink
>>
>> rule ClassConformityRule extends ElementMatchingRule{
>>
>> from e1: UML2!Class, e2: UML2!Class(e1.match(e2))
>>
>> to r : AMW!ClassConformityR}
>>
>> rule PropertyEqualityRule extends ElementMatchingRule{
>>
>> from e1: UML2!property, e2: UML2!Property(e1.match(e2))
>>
>> to r : AMW!PropertyEqualityR (
>>
>> parent <- thisModule.resolveTemp(e1.class,'r') )}
>>
>> when i use the resolveTemp function i have an exception , how can i create
>> the reference parent to the ClassConformityR
>>
>> Thanks,
>> Adil
>>
>> GRAVE: ****** BEGIN Stack Trace
>>
>> GRAVE: message: ERROR: could not find operation getNamedTargetFromSource
>> on Void having supertypes: [OclAny]
>>
>> GRAVE: A.main() : ??#86 null
>>
>> GRAVE: local variables = {self=UML2Corresp : ASMModule}
>>
>> GRAVE: local stack = []
>>
>> GRAVE: A.__exec__() : ??#98 null
>>
>>
>>
>>
>>
>>
>
>
Re: [ATL] multiple pattern matching with resolveTemp [message #72807 is a reply to message #72718] Fri, 18 January 2008 18:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hello,
Thanks Marcos,
now, I was able to run my transformation without having an execption,
but i still have the same problem , no value was affected into variable
parent in my target model !!
is still this a problem with resolveTemp ??

Regards,
Adil



> transformation
"Marcos Didonet Del Fabro" <mddfabro@ilog.fr> a
Re: [ATL] multiple pattern matching with resolveTemp [message #72821 is a reply to message #72807] Fri, 18 January 2008 18:31 Go to previous message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi Marcos,
the problem is resolved when i write this code in the do section.
do {
r.parent <- thisModule.resolveTemp(
Tuple{
e1= e1.class,
e2 = e2.class},'r');
}
thanks a lot
Regards,
Adil

"Adil Anwar" <adilanwar10@yahoo.fr> a
Previous Topic:[ATL] intermodel reference assignment not working...
Next Topic:[ATL] Converting XML to EMF/Ecore-based Language
Goto Forum:
  


Current Time: Sun Apr 11 02:27:04 GMT 2021

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

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

Back to the top