Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » ETL rule execution
ETL rule execution [message #23160] Thu, 23 July 2009 10:53 Go to next message
No real name is currently offline No real nameFriend
Messages: 92
Registered: July 2009
Member
Hi again,

Just a quick question which I couldn't find an answer to in the Epsilon
book (I might have missed it though):

Does a non-abstract, non-lazy ETL rule only get fired once during a
transformation -- and then the result is cached somewhere? I ask as I was
curious as to whether the following code fragment is bad practice...

var x := sourceComponent.equivalents('ruleX').select(i |
i.isKindOf(SomeClass));
var y := sourceComponent.equivalents('ruleX').select(i |
i.isKindOf(OtherClass));

So, does ruleX get fired 2 times internally, or does its result get stored
somewhere and is just (selectively) retrieved 2 times -- or perhaps I've
just totally missed the target :)?!

I guess this question touches upon some differences between rules and
operations... maybe?

Thanks in advance,

Edd
Re: ETL rule execution [message #23202 is a reply to message #23160] Thu, 23 July 2009 15:19 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Edd,

Edward Turner wrote:
> Hi again,
>
> Just a quick question which I couldn't find an answer to in the Epsilon
> book (I might have missed it though):
>
> Does a non-abstract, non-lazy ETL rule only get fired once during a
> transformation -- and then the result is cached somewhere?

That is correct.

I ask as I
> was curious as to whether the following code fragment is bad practice...
>
> var x := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(SomeClass));
> var y := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(OtherClass));
>
> So, does ruleX get fired 2 times internally, or does its result get
> stored somewhere and is just (selectively) retrieved 2 times -- or
> perhaps I've just totally missed the target :)?!

No. It actually runs only once and the second time you get the cached
results.
>
> I guess this question touches upon some differences between rules and
> operations... maybe?

You can have cached operations as well (i.e. run first time only, then
return cached result) by attaching the @cached annotation. E.g.

@cached
operation foo() {

}

>
> Thanks in advance,
>
> Edd
>

Cheers,
Dimitris
Re: ETL rule execution [message #571011 is a reply to message #23160] Thu, 23 July 2009 15:19 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Edd,

Edward Turner wrote:
> Hi again,
>
> Just a quick question which I couldn't find an answer to in the Epsilon
> book (I might have missed it though):
>
> Does a non-abstract, non-lazy ETL rule only get fired once during a
> transformation -- and then the result is cached somewhere?

That is correct.

I ask as I
> was curious as to whether the following code fragment is bad practice...
>
> var x := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(SomeClass));
> var y := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(OtherClass));
>
> So, does ruleX get fired 2 times internally, or does its result get
> stored somewhere and is just (selectively) retrieved 2 times -- or
> perhaps I've just totally missed the target :)?!

No. It actually runs only once and the second time you get the cached
results.
>
> I guess this question touches upon some differences between rules and
> operations... maybe?

You can have cached operations as well (i.e. run first time only, then
return cached result) by attaching the @cached annotation. E.g.

@cached
operation foo() {

}

>
> Thanks in advance,
>
> Edd
>

Cheers,
Dimitris
Previous Topic:ETL rule execution
Next Topic:[EuGENia] significance of Synchronize GMF Gen model
Goto Forum:
  


Current Time: Fri Mar 29 05:08:49 GMT 2024

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

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

Back to the top