Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Re: [ATL] problems to reference remote rules
Re: [ATL] problems to reference remote rules [message #37770] Tue, 15 May 2007 06:11 Go to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

Thank you for prefixing the subject of your post with [ATL]. However,
this question would fit better in the eclipse.modeling.m2m newsgroup,
which I added in copy of my answer.


> I'm trying to associate n elements in diferent rules.
> In order to do that, I'm using the thisModule.resolveTemp() as I have
> seem in the ATL User Manual and other sample codes. However, I'm having
> the folowing error message:
> "ERROR: could not find operation getNamedTargetFromSource on Void
> having supertypes: [OclAny]"
>
> The folloing rules ilustrate what I'm tring to do:
>
> rule ClassToBlock{
> from
> class : uml!Class
> to
> block: myMetamodel!Block(
> name<-class.name
> )
> }
>
> rule ModelToModel {
> from
> uml_model : uml!Model
> to
> system : myMetamodel!System (
> name <-uml_model.name,
> blocks<- thisModule.resolveTemp(uml!Class, 'subsystem')
> ),
> simulink_model : myMetamodel!Model(
> name<-uml_model.name,
> system<-system
> )
> }
> Using these rules I would like to make system to point for a
> collection of blocks.

Why don't you write something like:

blocks <- uml_model.allClasses

(depending on your metamodel, you may need to define the recursive
"allClasses" attribute helper to retrieve all the classes directly and
indirectly contained in uml_model)

or (without needing a helper, but only working if there is a single
uml!Model in your source model):

blocks <- uml!Class.allInstancesFrom('IN')

where IN is the name of your source model.



Because there is only one element created for each class in rule
ClassToBlock, you do not need resolveTemp: ATL will automatically
resolve the classes into blocks for you ;-).


Regards,

Frédéric Jouault
Re: [ATL] problems to reference remote rules [message #38357 is a reply to message #37770] Tue, 15 May 2007 17:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marciofsoliveira.gmail.com

"Fr
Re: [ATL] problems to reference remote rules [message #38390 is a reply to message #37770] Tue, 15 May 2007 17:14 Go to previous message
Eclipse UserFriend
Originally posted by: marciofsoliveira.gmail.com

Hi Fr
Previous Topic:[ATL] how to define multiples guards in from clause of a rule ?
Next Topic:[ATL] how to keep reference to source Model in target model
Goto Forum:
  


Current Time: Mon Jan 18 08:39:32 GMT 2021

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

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

Back to the top