multiple pattern matching with resolveTemp [message #72625] |
Fri, 18 January 2008 14:57 |
Eclipse User |
|
|
|
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 #72718 is a reply to message #72640] |
Fri, 18 January 2008 16:48 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03204 seconds