Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL polymorphism
ATL polymorphism [message #79566] Fri, 18 April 2008 12:10 Go to next message
Eclipse UserFriend
Originally posted by: marta.rivera.opensynergy.com

Hi!
I’m trying to transform a model with a chain of aggregations to another
with an inheritance chain:
class a ------- transformation to ------> class A
owns 0..1 instanceOfb owns 0..* instanceOfB
class b class B (abstract)
inherits
owns 0..* instanceOfd class C (abstract)
inherits
class d ------- transformation to ------> class D

For the transformation only the first and last classes of the chain are
interesting. I’d tryed:

rule one {
from i: model1!a
to o: model2!A (
attribute <- i.attribute,

instanceOfB.D <- i.instanceOfb.instanceOfd
-- syntax error: mismatched input ‚.‘ expected LARROW

instanceOfB <- (i. instanceOfb. instanceOfd).oclAsType(model2!D)
--ClassCastException
)
}

Which is the right way write the rule?

Thank you in advance.
Re: ATL polymorphism [message #80251 is a reply to message #79566] Tue, 29 April 2008 07:24 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

Could you please remember to prefix the subject of your ATL-related
posts with [ATL]? See: http://wiki.eclipse.org/M2M

It seems that you miss a comma on the line with the syntax error.

Regards,

Frédéric Jouault

marta a écrit :
> Hi!
> I�m trying to transform a model with a chain of aggregations to another
> with an inheritance chain: class a ------- transformation to
> ------> class A
> owns 0..1 instanceOfb owns 0..* instanceOfB
> class b class B (abstract)
> inherits
> owns 0..* instanceOfd class C (abstract)
> inherits
> class d ------- transformation to ------> class D
>
> For the transformation only the first and last classes of the chain are
> interesting. I�d tryed:
>
> rule one {
> from i: model1!a
> to o: model2!A (
> attribute <- i.attribute,
>
> instanceOfB.D <- i.instanceOfb.instanceOfd
> -- syntax error: mismatched input �.� expected LARROW
>
> instanceOfB <- (i. instanceOfb. instanceOfd).oclAsType(model2!D)
> --ClassCastException
> )
> }
>
> Which is the right way write the rule?
>
> Thank you in advance.
>
>
Previous Topic:Open Atl Editor Through Line Code
Next Topic:[ATL] How to put model elements in a package that is created in another rule?
Goto Forum:
  


Current Time: Thu Apr 25 22:54:47 GMT 2024

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

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

Back to the top