|
Re: 1..* transformation in QVT [message #531277 is a reply to message #531081] |
Tue, 04 May 2010 11:57 |
Eclipse User |
|
|
|
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl
Hello daniele,
I'm in no way an export in QVT, but I'll try to answer your questions
with the knowledge I do have.
> If i do A::AtoB():B several times, the mapping is executed only one
> time. I need instead that it's executed each time, creating new B
> instances in the target model.
Assuming AtoB is a mapping, the first time you map something using that
mapping, a new target element is created. Each time after that, the
trace information is used to get that same target element, if you map
the same source element using the same mapping function (and with the
same parameters). I think that is the way it is officially defined.
> For now the only way I found to do this, is create new instances
> programmatically ( object B {...} or deepclone() ) but in this
> way i can't use "resolve" on new instances.
I use deepclone() as well. I haven't found another way to do it. So far,
I haven't really used resolve yet, I just map it again, and get the same
result. However, if you have mappings with parameters and you don't have
the parameters available at each point where you need to map, you might
need to 'late resolve' instead.
Dennis
daniele wrote:
> I have a problem with a 1..* transformation.
>
> i.e.
> a class of the source model becomes several instances in the target model.
>
> If i do A::AtoB():B several times, the mapping is executed only one
> time. I need instead that it's executed each time, creating new B
> instances in the target model.
>
> For now the only way I found to do this, is create new instances
> programmatically ( object B {...} or deepclone() ) but in this way
> i can't use "resolve" on new instances.
>
> There should be a way to do this, right? Otherwise resolveIn was
> useless ...
>
> thank you
>
> Daniele
>
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03223 seconds