Home » Modeling » Epsilon » [ETL] Rule Execution Scheduling([ETL] Rule Execution Scheduling)
[ETL] Rule Execution Scheduling [message #1403221] |
Tue, 22 July 2014 12:49 |
Eclipse User |
|
|
|
Hello, I have the following issues:
1. What is the rule order scheduling of ETL? It is not explicitly stated in the Epsilon manual, however I have experimented and figured out that the rules are executed from top to bottom in the file (Assuming that you have only one transformation file). On the other hand, if you make equivalent/s calls, then the engine jumps to relevant rules and comes back where it was left.
2. I have found out the following issue about the parametric equivalent/s calls. Please check the following bug first: https://bugs.eclipse.org/bugs/show_bug.cgi?id=438615 . First, I have put a dummy lazy variable to make the parametric equivalent/s calls work. Then, if you do a parametric call, I expect that the engine checks/executes only the rule in the parameter. However, even if you provide a specific rule name as parameter, it checks every rule which is applicable by evaluating its guard. A pseudo-example is as follows:
rule Rule1 transform A to B{ guard: G1 }
rule Rule2 transform A to C{ guard: G2 }
rule Rule3 transform A to D{ guard: G3 }
...
//The following statement does not execute bodies of the rules however executes G1, G2 and G3 despite the fact that I call only Rule2
instanceA.equivalent("Rule2");
|
|
|
Re: [ETL] Rule Execution Scheduling [message #1403370 is a reply to message #1403221] |
Wed, 23 July 2014 10:19 |
|
Hi,
First off all, ETL is a miexed (declarative + imperative) transformation language. In general, the declarative nature will make ETL choose whatever schedule it suits best. Possibly, the first attempt would be to follow rule order in the source file. This behaviour will be modified by annottaions, specifically @lazy and @greedy. Imperative behavior, like parametric equivalent calls, will also modify this behavior.
In your example, Rule2 will be invoqued imperitively when invoqued. However, since your rule doesn't have a @lazy annotation, it will also be invoqued as part of the global schedule. So if you want a rule only to be executed when invoked imperativly you must annotate it with @lazy.
There is post about the semantics of the annotations in a previous post. I will try to find it and link it.
[Edit] Found it:
https://www.eclipse.org/forums/index.php/m/800855/?srch=epsilon+annotations#msg_800855
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
[Updated on: Wed, 30 July 2014 09:53] Report message to a moderator
|
|
|
Re: [ETL] Rule Execution Scheduling [message #1403384 is a reply to message #1403370] |
Wed, 23 July 2014 11:26 |
Eclipse User |
|
|
|
Hello Horacio, thanks for the answer!
I got the answer for my first question, however I may have some shortcoming for explaining the second example.
In the second example, the rules 1,2 and 3 are executed first by the engine since they are not declared as lazy. After that, when you make an equivalent call with "Rule2" as parameter, what you expect is, it checks ONLY Rule2 and returns the already created output element (if it is not executed, which is not case for our example, the call causes the rule execution and returns the output again as well). Actually, what it does is the following: It still returns the output of Rule2, it also checks all the possible/applicable rules for the instance (not only Rule2), which causes G1, G2 and G3 to be executed more than once.
In other words, it first executes the rules 1, 2 and 3 and accordingly the guards G1, G2 and G3 as the rules are actually being executed and output elements are created. After that, if you make the call instanceA.equivalent("Rule2") later, the engine executes guards G1, G2 and G3 again, which I expected it will only execute G2 since I give "Rule2" as parameter.
|
|
| |
Goto Forum:
Current Time: Fri Apr 19 21:12:03 GMT 2024
Powered by FUDForum. Page generated in 0.03098 seconds
|