Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Source pattern not executing on lazy rule
[ATL] Source pattern not executing on lazy rule [message #12175] Thu, 25 January 2007 11:41 Go to next message
Ronan is currently offline RonanFriend
Messages: 10
Registered: July 2009
Junior Member
Hi,
I have the following issue (code is simplified). When I call a lazy rule
the source pattern does not seem to execute. For example if I call the
lazy rule below with the code activities <-
thisModule.MappingsToAssign(mp);

lazy rule MappingsToAssign{
from
mp : MMa!Mappings
(
mp."from".message.debug('fired') = 'Initial'
)
to
ass : MMb!Assign()
}

If I try to access the properties of mp in the to section I have access to
its properties. However, the dubug statement in the from clause never runs
nor does the source get filtered.

I have tried a similar source pattern in a "normal" matched rule and it
executes fine, but I need to use a lazy rule for this particular match.

Any ideas?
Cheers,
Ronan
Re: [ATL] Source pattern not executing on lazy rule [message #12180 is a reply to message #12175] Thu, 25 January 2007 20:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rchevrel.sodius.com

Hi Ronan,

I think your problem come from the call. A lazy rule is called on a
collection, not on an element. You can try to call your lazy rule on a
collection of MMa!Mappings without any change, or transform your lazy
rule on a called rule :


<- thisModule.MappingsToAssign(mp);


rule MappingsToAssign (mp : MMa!Mappings) {
to
ass : MMb!Assign()
}

But you have to check the condition (mp."from".message = 'Initial')
before calling.

Best regard,

Régis Chevrel (Sodius)



Ronan a écrit :
> Hi,
> I have the following issue (code is simplified). When I call a lazy rule
> the source pattern does not seem to execute. For example if I call the
> lazy rule below with the code activities <-
> thisModule.MappingsToAssign(mp);
>
> lazy rule MappingsToAssign{
> from mp : MMa!Mappings
> (
> mp."from".message.debug('fired') = 'Initial'
> )
> to
> ass : MMb!Assign()
> }
>
> If I try to access the properties of mp in the to section I have access
> to its properties. However, the dubug statement in the from clause never
> runs nor does the source get filtered.
>
> I have tried a similar source pattern in a "normal" matched rule and it
> executes fine, but I need to use a lazy rule for this particular match.
>
> Any ideas?
> Cheers,
> Ronan
>
Re: [ATL] Source pattern not executing on lazy rule [message #13114 is a reply to message #12180] Mon, 29 January 2007 12:25 Go to previous message
Ronan is currently offline RonanFriend
Messages: 10
Registered: July 2009
Junior Member
Hi Régis,
Thanks for that. I have also tried that lazy rule with a collection.
However regardless of what I pass in the "from filter" never executes. The
lazy rule and called rule solutions both work fine assuming I filter the
collection before executing the rules. Perhaps filters are not supposed to
be defined on lazy rules?
Cheers,
Ronan
Previous Topic:Problem when creating output objects using Called Rules
Next Topic:Model format
Goto Forum:
  


Current Time: Fri Nov 08 22:21:58 GMT 2024

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

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

Back to the top