|
|
Re: Generating custom composite IDs [message #766808 is a reply to message #766367] |
Fri, 16 December 2011 13:15 |
Aleksandar Shterev Messages: 2 Registered: December 2011 |
Junior Member |
|
|
Hi Ed,
thank you for replying.
Ed Merks wrote on Thu, 15 December 2011 11:27I'm not sure though how your references are looking right now. Can one place with a reference to
"10" refer to a different thing than a reference to "10" elsewhere? I.e.,
Yes, that's exactly how it works, I know it's weird.. If I try to load the file in a resource like I normally would, I get a number of ClassCastExceptions because an ImageModel is resolved for a reference where a TextModel should have been. And in the model, the IDs are indeed ambiguous.
Therefore I was looking for a way to add prefices as a sort of namespaces. I actually got it working and now I'm looking to any inconsistencies. My idea is to change the IDs, save (and essentially "fix") the original resources, so they are all valid EMF models from this point on.
But I'll definitely look into the EDataType prefix - sooner or later I would probably have to do this conversion backwards as well..
Thanks again,
Alex
|
|
|
Re: Generating custom composite IDs [message #767189 is a reply to message #766808] |
Sat, 17 December 2011 09:07 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Aleksandar,
Comments below.
On 16/12/2011 2:15 PM, Aleksandar Shterev wrote:
> Hi Ed,
>
> thank you for replying.
> Ed Merks wrote on Thu, 15 December 2011 11:27
>> I'm not sure though how your references are looking right now. Can
>> one place with a reference to "10" refer to a different thing than a
>> reference to "10" elsewhere? I.e.,
>
>
> Yes, that's exactly how it works, I know it's weird..
It's certainly not something you can specify with XML Schema (other than
perhaps with keyref).
> If I try to load the file in a resource like I normally would, I get a
> number of ClassCastExceptions because an ImageModel is resolved for a
> reference where a TextModel should have been. And in the model, the
> IDs are indeed ambiguous.
> Therefore I was looking for a way to add prefices as a sort of
> namespaces. I actually got it working and now I'm looking to any
> inconsistencies. My idea is to change the IDs, save (and essentially
> "fix") the original resources, so they are all valid EMF models from
> this point on.
That's probably better in the long term.
>
> But I'll definitely look into the EDataType prefix - sooner or later I
> would probably have to do this conversion backwards as well..
I asked about the references because the data type thing only helps with
the IDs themselves. To fix references you'd probably want to defer all
ID resolution and then modify the handleForwardReferences so that the
prefix is added based on the feature from which the reference occurs.
>
>
> Thanks again,
> Alex
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02820 seconds