Home » Archived » M2M (model-to-model transformation) » [QVT] missing model elements
[QVT] missing model elements [message #717893] |
Mon, 22 August 2011 16:20 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
Hi,
rather than asking a detailed question concerning one of my
transformation, I'd like to ask the newsgroup whether anyone ever faced
the problem of disappearing model elements supposed to be contained in
the target model? The concrete misbehaviour I observe is that in one of
my transformation certain model elements suddenly "get lost" during the
transformation. Using the debug view I'm somehow able the location,
however I cannot explain it. To be more precise, until this above
mentioned location, my transformation works proper, the in-memory target
model looks well, but suddenly, as already mentioned, certain model
elements just "get lost". So again, has anybody already faced a problem
like this and maybe can provide some hints or ideas on how to resolve it?
Thanks a lot in advance!
Cheers,
Philipp
|
|
|
Re: [QVT] missing model elements [message #717910 is a reply to message #717893] |
Mon, 22 August 2011 16:38 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi Philipp
Element disappearance is often associated with putting the element into
a new BasicEList with containment. So since EMF supports only single
containment, putting an element in a container here, takes it out of a
container there. Look very carefully at any added code with
containers/resources. If still baffled, put a 'printf' in a derived
eBasicSetContainer().
Regards
Ed Willink
On 22/08/2011 17:20, Philipp Zech wrote:
> Hi,
>
> rather than asking a detailed question concerning one of my
> transformation, I'd like to ask the newsgroup whether anyone ever
> faced the problem of disappearing model elements supposed to be
> contained in the target model? The concrete misbehaviour I observe is
> that in one of my transformation certain model elements suddenly "get
> lost" during the transformation. Using the debug view I'm somehow able
> the location, however I cannot explain it. To be more precise, until
> this above mentioned location, my transformation works proper, the
> in-memory target model looks well, but suddenly, as already mentioned,
> certain model elements just "get lost". So again, has anybody already
> faced a problem like this and maybe can provide some hints or ideas on
> how to resolve it?
>
> Thanks a lot in advance!
>
> Cheers,
>
> Philipp
|
|
|
Re: [QVT] missing model elements [message #717919 is a reply to message #717910] |
Mon, 22 August 2011 17:22 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
On 08/22/2011 06:38 PM, Ed Willink wrote:
> Hi Philipp
>
> Element disappearance is often associated with putting the element into
> a new BasicEList with containment. So since EMF supports only single
> containment, putting an element in a container here, takes it out of a
> container there. Look very carefully at any added code with
> containers/resources. If still baffled, put a 'printf' in a derived
> eBasicSetContainer().
>
> Regards
>
> Ed Willink
>
>
> On 22/08/2011 17:20, Philipp Zech wrote:
>> Hi,
>>
>> rather than asking a detailed question concerning one of my
>> transformation, I'd like to ask the newsgroup whether anyone ever
>> faced the problem of disappearing model elements supposed to be
>> contained in the target model? The concrete misbehaviour I observe is
>> that in one of my transformation certain model elements suddenly "get
>> lost" during the transformation. Using the debug view I'm somehow able
>> the location, however I cannot explain it. To be more precise, until
>> this above mentioned location, my transformation works proper, the
>> in-memory target model looks well, but suddenly, as already mentioned,
>> certain model elements just "get lost". So again, has anybody already
>> faced a problem like this and maybe can provide some hints or ideas on
>> how to resolve it?
>>
>> Thanks a lot in advance!
>>
>> Cheers,
>>
>> Philipp
>
Hi Ed,
thanks for the fast reply. I'll check my stuff tomorrow.
Cheers,
Philipp
|
|
|
Re: [QVT] missing model elements [message #718150 is a reply to message #717919] |
Tue, 23 August 2011 12:16 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
On 08/22/2011 07:22 PM, Philipp Zech wrote:
> On 08/22/2011 06:38 PM, Ed Willink wrote:
>> Hi Philipp
>>
>> Element disappearance is often associated with putting the element into
>> a new BasicEList with containment. So since EMF supports only single
>> containment, putting an element in a container here, takes it out of a
>> container there. Look very carefully at any added code with
>> containers/resources. If still baffled, put a 'printf' in a derived
>> eBasicSetContainer().
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 22/08/2011 17:20, Philipp Zech wrote:
>>> Hi,
>>>
>>> rather than asking a detailed question concerning one of my
>>> transformation, I'd like to ask the newsgroup whether anyone ever
>>> faced the problem of disappearing model elements supposed to be
>>> contained in the target model? The concrete misbehaviour I observe is
>>> that in one of my transformation certain model elements suddenly "get
>>> lost" during the transformation. Using the debug view I'm somehow able
>>> the location, however I cannot explain it. To be more precise, until
>>> this above mentioned location, my transformation works proper, the
>>> in-memory target model looks well, but suddenly, as already mentioned,
>>> certain model elements just "get lost". So again, has anybody already
>>> faced a problem like this and maybe can provide some hints or ideas on
>>> how to resolve it?
>>>
>>> Thanks a lot in advance!
>>>
>>> Cheers,
>>>
>>> Philipp
>>
> Hi Ed,
>
> thanks for the fast reply. I'll check my stuff tomorrow.
>
> Cheers,
>
> Philipp
Hi,
so to clear things up, Ecore does not support any structures like
List := [elem1, elem2, elem3]
where elem1-3 itself have containment references to other elements?
Thanks in advance,
Philipp
|
|
|
Re: [QVT] missing model elements [message #718229 is a reply to message #718150] |
Tue, 23 August 2011 16:03 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi Philipp
No. Ecore supports exactly what you suggest.
ContainmentList1 := [elem1, elem2, elem3]
but when you construct
ContainmentList2 := [elem2, elem3, elem4]
you change
ContainmentList1 := [elem1]
since no element can have more than one container.
Regards
Ed Willink
On 23/08/2011 13:16, Philipp Zech wrote:
> Hi,
>
> so to clear things up, Ecore does not support any structures like
>
> List := [elem1, elem2, elem3]
>
> where elem1-3 itself have containment references to other elements?
>
> Thanks in advance,
>
> Philipp
|
|
|
Re: [QVT] missing model elements [message #718230 is a reply to message #718229] |
Tue, 23 August 2011 16:22 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
On 08/23/2011 06:03 PM, Ed Willink wrote:
> Hi Philipp
>
> No. Ecore supports exactly what you suggest.
>
> ContainmentList1 := [elem1, elem2, elem3]
>
> but when you construct
>
> ContainmentList2 := [elem2, elem3, elem4]
>
> you change
>
> ContainmentList1 := [elem1]
>
> since no element can have more than one container.
>
> Regards
>
> Ed Willink
> On 23/08/2011 13:16, Philipp Zech wrote:
>> Hi,
>>
>> so to clear things up, Ecore does not support any structures like
>>
>> List := [elem1, elem2, elem3]
>>
>> where elem1-3 itself have containment references to other elements?
>>
>> Thanks in advance,
>>
>> Philipp
>
>
Hi Ed,
hm, I think I'm missing something. In my transformation I create an
element, lets call it ElemOfInterest. This ElemOfInterest contains a
list of elements. Now, during the transformation this list is filled,
however, as soon as the this ElemOfInterest is assigned to its parent
element, the list suddenly is empty. Why is my list suddenly empty? I
just don't get it...
Again, thanks in advance,
Philipp
PS: sorry for sending the message to your email address and not to the list
|
|
|
Re: [QVT] missing model elements [message #718249 is a reply to message #718230] |
Tue, 23 August 2011 17:54 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
On 08/23/2011 06:22 PM, Philipp Zech wrote:
> On 08/23/2011 06:03 PM, Ed Willink wrote:
>> Hi Philipp
>>
>> No. Ecore supports exactly what you suggest.
>>
>> ContainmentList1 := [elem1, elem2, elem3]
>>
>> but when you construct
>>
>> ContainmentList2 := [elem2, elem3, elem4]
>>
>> you change
>>
>> ContainmentList1 := [elem1]
>>
>> since no element can have more than one container.
>>
>> Regards
>>
>> Ed Willink
>> On 23/08/2011 13:16, Philipp Zech wrote:
>>> Hi,
>>>
>>> so to clear things up, Ecore does not support any structures like
>>>
>>> List := [elem1, elem2, elem3]
>>>
>>> where elem1-3 itself have containment references to other elements?
>>>
>>> Thanks in advance,
>>>
>>> Philipp
>>
> >
> Hi Ed,
>
> hm, I think I'm missing something. In my transformation I create an
> element, lets call it ElemOfInterest. This ElemOfInterest contains a
> list of elements. Now, during the transformation this list is filled,
> however, as soon as the this ElemOfInterest is assigned to its parent
> element, the list suddenly is empty. Why is my list suddenly empty? I
> just don't get it...
>
> Again, thanks in advance,
>
> Philipp
>
> PS: sorry for sending the message to your email address and not to the list
Hi Ed,
thanks again for your hints, it's working now. But I'm already facing
the next interesting situation. The elements in my target model contain
various attributes, among them also attributes of type string. Sometimes
it is the case, that these attributes hold the same string, i.e.
"aaaaa". Interestingly, this string is exactly stored in one attribute
inside the whole model, all the other attributes, that actually should
contain this same string, are empty. Is this also due to single
containment? And is there some workaround possible?
Again, thank you very much.
Cheers,
Philipp
|
|
| |
Re: [QVT] missing model elements [message #718454 is a reply to message #718259] |
Wed, 24 August 2011 11:35 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
On 08/23/2011 08:13 PM, Ed Willink wrote:
> Hi
>> thanks again for your hints, it's working now. But I'm already facing
>> the next interesting situation. The elements in my target model
>> contain various attributes, among them also attributes of type string.
>> Sometimes it is the case, that these attributes hold the same string,
>> i.e. "aaaaa". Interestingly, this string is exactly stored in one
>> attribute inside the whole model, all the other attributes, that
>> actually should contain this same string, are empty. Is this also due
>> to single containment?
> Very very unlikely.
>> And is there some workaround possible?
>>
> Yes. Debug your code.
>
> Regards
>
> Ed Willink
Hm, this is quite strange, as I do not remove any elements from any
lists, but rather create new String objects all the time, which aren't
assigned to any list but simply to an attribute. Debugging so far
reveals nothing strange, using the same idea to create my strings works
one time, but not the other...
|
|
|
Re: [QVT] missing model elements [message #718549 is a reply to message #718454] |
Wed, 24 August 2011 16:28 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi Philipp
You think you have an object that loses its container.
Therefore either:
you are mistaken
the object changes from non-null to null container
the object changes from non-null to differently non-null container
the containment list is replaced in its entirety.
'printf' in eBasicSetContainer will enable you to tackle the first three
and by printing out hashCodes (addresses) you can check whether
the object that loses its container is in your 'printf' log.
Regards
Ed Willink
On 24/08/2011 12:35, Philipp Zech wrote:
> On 08/23/2011 08:13 PM, Ed Willink wrote:
>> Hi
>>> thanks again for your hints, it's working now. But I'm already facing
>>> the next interesting situation. The elements in my target model
>>> contain various attributes, among them also attributes of type string.
>>> Sometimes it is the case, that these attributes hold the same string,
>>> i.e. "aaaaa". Interestingly, this string is exactly stored in one
>>> attribute inside the whole model, all the other attributes, that
>>> actually should contain this same string, are empty. Is this also due
>>> to single containment?
>> Very very unlikely.
>>> And is there some workaround possible?
>>>
>> Yes. Debug your code.
>>
>> Regards
>>
>> Ed Willink
>
> Hm, this is quite strange, as I do not remove any elements from any
> lists, but rather create new String objects all the time, which aren't
> assigned to any list but simply to an attribute. Debugging so far
> reveals nothing strange, using the same idea to create my strings
> works one time, but not the other...
|
|
|
Goto Forum:
Current Time: Tue Sep 24 16:12:17 GMT 2024
Powered by FUDForum. Page generated in 0.04992 seconds
|