Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] forcing late resolve
[QVTO] forcing late resolve [message #80893] Tue, 06 May 2008 16:01 Go to next message
Eclipse UserFriend
Originally posted by: comouraf-lixo.yahoo.fr

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
Re: [QVTO] forcing late resolve [message #80903 is a reply to message #80893] Tue, 06 May 2008 16:36 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi 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@yahoo.fr>
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/
Re: [QVTO] forcing late resolve [message #80912 is a reply to message #80903] Tue, 06 May 2008 17:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: comouraf-lixo.yahoo.fr

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@yahoo.fr>
> 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/
Re: [QVTO] forcing late resolve [message #80932 is a reply to message #80912] Tue, 06 May 2008 23:26 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
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@yahoo.fr>
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@yahoo.fr> 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/
Re: [QVTO] forcing late resolve [message #80960 is a reply to message #80932] Wed, 07 May 2008 08:49 Go to previous message
Eclipse UserFriend
Originally posted by: comouraf-lixo.yahoo.fr

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@borland.com> a écrit dans le message de
news:op.uaq918i5hj1a1g@czprl-rdvorak2.emea.borl.net...
>
> 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@yahoo.fr>
> 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@yahoo.fr> 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/
Previous Topic:forcing late resolve
Next Topic:[ATL] XML Injector in Eclipse 3.4
Goto Forum:
  


Current Time: Thu Apr 25 11:40:39 GMT 2024

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

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

Back to the top