[ATL] Problem with matched rule and multiple source models [message #80374] |
Tue, 29 April 2008 13:13 |
Luis Pedro Messages: 29 Registered: July 2009 |
Junior Member |
|
|
Hello,
I have a matched rule with multiple source models, and the problem is
that it does not get matched. The code follows:
rule init {
from
system : GenericCospel!System
to
coopnpackage: COOPNMetaModel!COOPNPackage(
name <- system.name,
ownedModules <- system.ownedTypes
)
}
rule ruleType {
from
c : COOPNMetaModel!COOPNPackage,
t : GenericCospel!Type
to
.....
}
Before putting the c variable in the source of ruleType, my result was a
match between ruleType and the last line in rule init, giving me a
hierarchy (things generated by ruleType were children of things
generated by init).
After I added c, the match is not done. I suppose because the source is
different from the system.ownedTypes type.
Since I need to have that c object further in the code, is there any way
to achieve this matching?
Thanks very much in advance,
|
|
|
Re: [ATL] Problem with matched rule and multiple source models [message #80751 is a reply to message #80374] |
Tue, 06 May 2008 09:35 |
William Piers Messages: 301 Registered: July 2009 |
Senior Member |
|
|
Hello,
Luis Pedro a écrit :
> Hello,
>
> I have a matched rule with multiple source models, and the problem is
> that it does not get matched. The code follows:
>
> rule init {
>
> from
> system : GenericCospel!System
> to
> coopnpackage: COOPNMetaModel!COOPNPackage(
> name <- system.name,
> ownedModules <- system.ownedTypes
> )
> }
>
> rule ruleType {
> from
> c : COOPNMetaModel!COOPNPackage,
> t : GenericCospel!Type
>
> to
> .....
> }
Here there is an error : you can't match output elements in the from
section. You need to refer to the corresponding input element. For
instance :
rule ruleType {
from
c : GenericCospel!System,
t : GenericCospel!Type
Best regards,
William
> Before putting the c variable in the source of ruleType, my result was a
> match between ruleType and the last line in rule init, giving me a
> hierarchy (things generated by ruleType were children of things
> generated by init).
> After I added c, the match is not done. I suppose because the source is
> different from the system.ownedTypes type.
>
> Since I need to have that c object further in the code, is there any way
> to achieve this matching?
>
> Thanks very much in advance,
|
|
|
Powered by
FUDForum. Page generated in 0.02312 seconds