Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] rule for abstract metaclass
[ATL] rule for abstract metaclass [message #89756] Wed, 03 September 2008 07:54 Go to next message
Monica ClÃ?©ment is currently offline Monica ClÃ?©mentFriend
Messages: 14
Registered: July 2009
Junior Member
Hello everybody, I have a new question. When I try to write a rule for an
abstract metaclass (example NamedElement):

rule namedElement{
from namedElement:SYSML!NamedElement
to nommeElement:UML!NamedElement (
name <- namedElement.name,
visibility <- namedElement.visibility,
clientDependency <- namedElement.clientDependency)
}

I get this error:
GRAVE: The class 'NamedElement' is not a valid classifier

Somebody can help me?

Thank you.

Monica.
Re: [ATL] rule for abstract metaclass [message #89785 is a reply to message #89756] Wed, 03 September 2008 08:17 Go to previous messageGo to next message
Guillaume Doux is currently offline Guillaume DouxFriend
Messages: 56
Registered: July 2009
Member
Hello,

The problem is that you try to instantiate NamedElement which is an
abstract class, so it is not possible.

If the question is that you want to use inheritance in rules, you must
set the rules for abstract classes as abstract.

So you obtain something like:

abstract rule namedElement{....}

After that you must have a rule for each subclasses of the abstract
class and use:

rule rule4aSubClass extends namedElement{...} (with namedElement the
name of the rule)



Best regards.


Guillaume

PS: do not forget to use atl compiler 2006 to use rules inheritance
(-- @atlcompiler atl2006)


Monica Clement a écrit :
> Hello everybody, I have a new question. When I try to write a rule for
> an abstract metaclass (example NamedElement):
>
> rule namedElement{
> from namedElement:SYSML!NamedElement
> to nommeElement:UML!NamedElement ( name <-
> namedElement.name, visibility <-
> namedElement.visibility,
> clientDependency <- namedElement.clientDependency)
> }
>
> I get this error: GRAVE: The class 'NamedElement' is not a valid classifier
>
> Somebody can help me?
>
> Thank you.
>
> Monica.
>
Re: [ATL] rule for abstract metaclass [message #89881 is a reply to message #89756] Wed, 03 September 2008 20:57 Go to previous message
Alfons Laarman is currently offline Alfons LaarmanFriend
Messages: 71
Registered: July 2009
Member
Hi Monica,

You should declare the rule as abstract:
abstract rule namedElement{



Regards,

Alfons

"Monica Clement" <monica.clement@gmail.com> schreef in bericht
news:22a49769ec9ea5dc048fd516804eda99$1@www.eclipse.org...
> Hello everybody, I have a new question. When I try to write a rule for an
> abstract metaclass (example NamedElement):
>
> rule namedElement{
> from namedElement:SYSML!NamedElement
> to nommeElement:UML!NamedElement ( name <- namedElement.name,
> visibility <- namedElement.visibility,
> clientDependency <- namedElement.clientDependency)
> }
>
> I get this error: GRAVE: The class 'NamedElement' is not a valid
> classifier
>
> Somebody can help me?
>
> Thank you.
>
> Monica.
>
Previous Topic:How to use distinct and foreach in called rules?
Next Topic:Error message : stereotype applied on Activity node
Goto Forum:
  


Current Time: Wed Jan 15 06:58:05 GMT 2025

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

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

Back to the top