Re: [mdr-users] createExtent(String, RefObject, RefPackage[])

Pieter Van Gorp <[email protected]> Tue, 9 Aug 2005 16:23:39 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi again,

On 8/9/05, Pieter Van Gorp <[email protected]> wrote:
> On 8/8/05, Martin Matula <[email protected]> wrote:
> > To fix this, you need to load the tracing metamodel. Now find UML
> > package in this tracing metamodel and instantiate it. If you now find
> > tracing package, instantiate it and pass in the instance of UML package,
> > the instance of UML package will be reused.
> Good to know,
> thanks for the insight, I'll try it right away!
After changing merely one line of code, the clustered extent was
indeed filled up with the content of the UML-XMI: I replaced
<original>appMextent= (RefPackage)
repo.createExtent(appMurl.toExternalForm(), getMainMP(appMMurl, "UML",
xmiReader));</original>

by: 

<new>appMextent= (RefPackage)
repo.createExtent(appMurl.toExternalForm(), getMainMP(traceMMurl,
"UML", xmiReader));</new>

Strange enough, I'm now confronted with the opposite problem: all UML
elements seem to be available twice!  Moreover, this leads to
"duplicate IDREF" exceptions when using XMI modules for importing UML
profiles.  I started debugging with a UML file without XMI modules (by
storing the UML profiles within my UML test project) and can now open
the XMI that MDR writes from the clustered UML extent to a file called
"standalone.xmi".  Luckily, MagicDraw ignores the duplicate model
elements... however, I believe I should remove the error in my code
that causes the duplication of model elements... Martin, am I still
using the API wrong?

Please refer to yesterday's mail for reproducing my problem:
http://mdr.netbeans.org/servlets/ReadMsg?list=users&msgNo=3255

Regards,
-- Pieter.