Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » does lazy rules from clause works?
does lazy rules from clause works? [message #987896] Wed, 28 November 2012 15:01 Go to next message
Alessandro Ranieri is currently offline Alessandro Ranieri
Messages: 16
Registered: November 2012
Junior Member
Hello to everyone,

I have a question about lazy rules, because the manual is quite synthetic about them.
I would like to know when the from clause is evaluated.
i.e. I make a call to a lazy rule in a matched rule in this way:



rule main {

from
m: UML!Model,
s: UML!Class ( m.name = 'model')
to
container1 : UML!Model
(
name<- 'graphModel',
packagedElement <- thisModule.host(s)
)
}


lazy rule host {

from
source : UML!Class (source.hasStereotype('lanprofile::Router'))

to
target : UML!Class
(
name <- 'nodo_router'
)
}



why the from clause in the lazy is not evaluated? (it was created target UML!Classes also for that source Classes that don't respect the condition in the round brackets) And, if this behaviour is correct, in which case the from clause make sense for lazy rules?


Thanks in advance,

Alessandro
Re: does lazy rules from clause works? [message #987933 is a reply to message #987896] Wed, 28 November 2012 17:08 Go to previous message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
Registered: July 2009
Senior Member
Hello,

The initial philosophy behind lazy (matched) rules is to be able to specify when matched rules are actually called.
Thus lazy rules should not have guard conditions, and the filtering should be done on the call:
packagedElement <- if s.hasStereotype('lanprofile::Router') then
                         thisModule.host(s) 
                   else
                         OclUndefined -- or something else
                   endif

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Previous Topic:EDate in the transformations
Next Topic:Java ATL transformation Obligations
Goto Forum:
  


Current Time: Thu Oct 30 19:16:12 GMT 2014

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

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