Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » Using a Generic MetaClass Name ?!
Using a Generic MetaClass Name ?! [message #90566] Fri, 26 September 2008 05:51 Go to next message
Eclipse UserFriend
Hi,
I would like to write a generic rule that calls a helper that computer the
type of the metaclass that will be generated, i wrote this code (that
doesn't work):

helper context UML2!Class def : GenericComponentName () :
AAXL!ComponentClassifier =
if self.isStereotypeApplied('MemoryPartition') then
AAXL!MemoryType
else if self.isStereotypeApplied('SwSchedulableResource') then
AAXL!ProcessType
else
AAXL!ComponentClassifier
endif
endif ;

rule ClassGeneric {
from a: UML2!Class (a.isAbstract())
--ERROR HERE-- to p: oclType(a.GenericComponentName())(name <- a.name)}

It seems that this is impossible to do this way because of the way ATL
computes the atl transformation file, does anybody have an idea of how to
do this?
[ATL] Re: Using a Generic MetaClass Name ?! [message #90834 is a reply to message #90566] Wed, 01 October 2008 05:35 Go to previous message
Eclipse UserFriend
Hello,

The "to" part of the rule can't be parametrized, you need to do that in
another way. For instance :

rule Class2MemoryType {
from a: UML2!Class (
a.isAbstract() and a.isStereotypeApplied('MemoryPartition'))
to p: AAXL!MemoryType ()
}

rule ClassGeneric {
from a: UML2!Class (
a.isAbstract() and a.isStereotypeApplied('
etc...

Best regards,

William

Skander a écrit :
> Hi,
> I would like to write a generic rule that calls a helper that computer
> the type of the metaclass that will be generated, i wrote this code
> (that doesn't work):
>
> helper context UML2!Class def : GenericComponentName () :
> AAXL!ComponentClassifier =
> if self.isStereotypeApplied('MemoryPartition') then
> AAXL!MemoryType
> else if self.isStereotypeApplied('SwSchedulableResource') then
> AAXL!ProcessType
> else
> AAXL!ComponentClassifier
> endif
> endif ;
>
> rule ClassGeneric {
> from a: UML2!Class (a.isAbstract())
> --ERROR HERE-- to p: oclType(a.GenericComponentName())(name <- a.name)}
>
> It seems that this is impossible to do this way because of the way ATL
> computes the atl transformation file, does anybody have an idea of how
> to do this?
>
>
Previous Topic:MARTE in km3
Next Topic:[QVTO] Input model parameter '...' is read-only!
Goto Forum:
  


Current Time: Sat May 10 13:55:37 EDT 2025

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

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

Back to the top