Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problem with matched rule and multiple source models
[ATL] Problem with matched rule and multiple source models [message #80374] Tue, 29 April 2008 13:13 Go to next message
Luis Pedro is currently offline Luis PedroFriend
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 Go to previous message
William Piers is currently offline William PiersFriend
Messages: 297
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,
Previous Topic:Re: Wich UML2 metamodel implemetation MagicDraw uses?
Next Topic:error lauch atl transformation programmatic - could not find model UML
Goto Forum:
  


Current Time: Mon Oct 21 20:00:57 GMT 2019

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

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

Back to the top