[EMFTVM] Could resolve functions return null when no image found ? [message #1256208] |
Tue, 25 February 2014 02:49  |
Eclipse User |
|
|
|
Dear Dennis,
I wanted to ask if it would be possible to add an option in the emftvm launcher in order to allow partial resolution of outut elements with the resolve operations (resolveTemp, resolve...). Indeed, I would like to activate or deactivate the fact that the emftvm throws an exception when resolveTemp does not manage to find the image of the source element passed as parameter.
One of the reasons for this is that I collect elements that could be produced by different rules and I don't want to repeat the condition of application of each rule variant all the time.
For instance, if I write (ATL pseudo code):
rule R1
{
from
e: IN!Element
(e.name='root')
to
r: OUT!Root
....
}
rule R2
{
from
e: IN!Element
(e.name='operation')
to
op: OUT!Operation
....
}
rule R
{
from
d_in: In!Diagram
to
d_out: OUT!Diagram
(
elements <- d_in.elements->select(e|e.name='root')
->collect(e|thisModule.resolveTemp(e, 'r'))
->union(d_in.elements->select(e|e.name='operation')
->collect(e|thisModule.resolveTemp(e, 'op'))
}
it works fine; but maintaining rule R becomes complex if I have too many way to map objects of type Element.
Instead of repeating the filter (select clause) in rule R, I would prefer to write:
rule R
{
from
d_in: In!Diagram
to
d_out: OUT!Diagram
(
elements <- d_in.elements->collect(e|thisModule.resolveTemp(e, 'r'))
->union(d_in.elements->collect(e|thisModule.resolveTemp(e, 'op'))
->excluding(OclUndefined)
)
}
The only problem here is that the EMFTVM runtime throws an exception if resolve functions do not work. Would it be possible to have an option in the emftvm launch in order to deactivate this exception, and return null (OclUndefined) instead?
I would find it more convenient to be able to control this behaviour with a simple option passed as parameter of the ExecEnv launch function or to the constructor of this class.
What is your opinion about this?
Thanks for your answer,
Etienne.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04227 seconds