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 06:53 Go to next message
No real name is currently offline No real name
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 11:19 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
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 11:19 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
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: Sat Aug 30 00:33:31 EDT 2014

Powered by FUDForum. Page generated in 0.06179 seconds