[ATL] creating aggregation relation between model elements [message #79216] |
Tue, 15 April 2008 09:07  |
Eclipse User |
|
|
|
Dear all,
I'm creating some transformation rules in ATL and I've the problem that
I'm not being able to create containment (aggregation) relations between
elements in the target model. This two of the rules I'm using:
rule init {
from
enumerations : enumerationDC!EnumerationDC
to
coopnpackage: COOPNMetaModel!COOPNPackage(
name <- 'COOPN_Enum_Package'
)
}
rule ADT {
from
dc : enumerationDC!DCEnum
to
coopnadt: COOPNMetaModel!"COOPNMetamodel::ADTModule::COOPNADT"(
name<- dc.name
)
}
COOPNMetaModel!COOPNPackage and COOPNMetamodel::ADTModule::COOPNADT are
related with each other by a 0..* aggregation (named "ownedModules")
with COOPNMetaModel!COOPNPackage as the EContaining Class.
Any hint on how can now associate the created coopnadt to the previously
created coopnpackage by the ownedModules aggregation?
Thanks very much in advance for your time and help.
Best regards,
Luis Pedro
|
|
|
|
Re: [ATL] creating aggregation relation between model elements [message #79272 is a reply to message #79258] |
Tue, 15 April 2008 11:43  |
Eclipse User |
|
|
|
Hi,
Thanks. I was not aware of that source of information! I was able to
solve the problem.
Again, thanks.
Best regards,
Luis Pedro
William Piers wrote:
> Hello,
>
> I put some indications inside your code :
>
> Luis Pedro a écrit :
>> Dear all,
>> I'm creating some transformation rules in ATL and I've the problem
>> that I'm not being able to create containment (aggregation) relations
>> between elements in the target model. This two of the rules I'm using:
>>
>> rule init {
>> from
>> enumerations : enumerationDC!EnumerationDC
>> to
>> coopnpackage: COOPNMetaModel!COOPNPackage(
>> name <- 'COOPN_Enum_Package'
> ownedModules <- -- put here an OCL expression retrieving --
> the list of enumerationDC!DCEnum, later transformed into coopnadt,
> -- that you want to link with coopnpackage.
> -- this may be a kind of : ownedModules <- enumerations.ownedDCEnum
>> )
>> }
>>
>> rule ADT {
>> from
>> dc : enumerationDC!DCEnum
>> to
>> coopnadt: COOPNMetaModel!"COOPNMetamodel::ADTModule::COOPNADT"(
>> name<- dc.name
>> ) }
>>
>> COOPNMetaModel!COOPNPackage and COOPNMetamodel::ADTModule::COOPNADT
>> are related with each other by a 0..* aggregation (named
>> "ownedModules") with COOPNMetaModel!COOPNPackage as the EContaining
>> Class.
>>
>> Any hint on how can now associate the created coopnadt to the
>> previously created coopnpackage by the ownedModules aggregation?
>>
>
> In order top better understand ATL implicit traceability links (between
> source and target model elements) I advise you to read those kind of
> simple examples : http://www.eclipse.org/m2m/atl/basicExamples_Patterns/
>
> Best Regards,
>
> William
>
>> Thanks very much in advance for your time and help.
>>
>> Best regards,
>>
>> Luis Pedro
|
|
|
Powered by
FUDForum. Page generated in 0.06411 seconds