[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [QVTO] forcing late resolve

Thank you for your kindness Radek, but I already solved the problem by removing all 'late' from my transformation. It's crazy that I spend more than two ours to figure out a solution maintaining the late resolve -to no avail - and only 10 minutes to roll back to the 'deterministic' approach - which I was avoiding, imagining that it would be such a chore...

But now I'm stuck in other problem ;-) I don't know why but I just can't access an object's owner. Looking at the source model, I can see it is inside its owner. Also, all elements have an 'owner' reference (which is the opposite of 'ownedElement', a containment-type reference). So I see no reason why I can't acces its owner. At the beginning of the mapping, I put the log, but it shows a beautiful Invalid_Class:

init{
 log('paramPort: '+self.owner.repr());
}

Any hint? I'm sending you by mail the project, in case you may be interested in taking a look at this apparently simple problem (please take a look at the mapping ParameteredPortInstance::toDeparameterizedPortInstance(in boundElement: BoundParameterableComponent):PortInstance.

Thanks,

CÃsar

"Radek Dvorak" <radek.dvorak@xxxxxxxxxxx> a Ãcrit dans le message de news:op.uaq918i5hj1a1g@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Note that 'late resolve' returns 'null' value in normal execution time and
the assignment using it as its left side value is not executed this time but
only at deferred time.
Also, only assignments are tracked back during deferred execution so you
may use the result of 'late resolve' calls only in assignments to a property.
If you need to access some properties on it you have to use normal 'resolve'
and gain control over the correct ordering by multiple passes.


Difficult to say what happens in your particular case.
In case you would not find a way to solve that, do not hesitate to come up
with you QVT code, so we can figure out.

/Radek


On Tue, 06 May 2008 19:53:35 +0200, kaiserlautern <comouraf-lixo@xxxxxxxx> wrote:


Hi, Radek,

I begun the transformation using different passes, one for the main tree (containment tree) and one for each type of reference, in a very deterministic approach. But then, I don't remember well why -maybe by laziness- , I decided to use late resolve with the last type of reference. As I did not remember this detail, it took me almost two hours to realize the problem, because looking at the generated target model, all references were there ;-)
Besides, just to check, I removed the 'late' from the resolves, but it broke the transformation from the beginning, so I can't see other way out, other than using the multiple-pass approach to the end. Or am I missing something?


CÃsar


The 'late resolve' is always to be executed in the end of the transformation,
just after the body of main() has finished its job.
If you do not want to wait until that time, you can use the available variants of
normal 'resolve'. In this case, you always get the objects instantly available
in traces.
As you have mentioned, this requires a bit of specific knowledge of the
transformation writer, in order to know whether neccessary traces have already been created
based on the execution flow.


Though, I'm not sure, I completely got your problem.

Regard,
/Radek


On Tue, 06 May 2008 18:01:29 +0200, kaiserlautern <comouraf-lixo@xxxxxxxx> wrote:


Hi,

At some specific parts of my transformation I decided to use late resolve
:-(. But now I realize that I need some objects halfway through my
transformation - and not at the end, when 'late resolve' resolves the references.
So, I'd like to know if there is a way of forcing pending references (to be
used, at my own risk, at some point when I know that all objects from the
first part of the transformation should already be created).


Thank you in advance,

CÃsar




-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/