|
Re: xmi Id in Dependency [message #477224 is a reply to message #477179] |
Wed, 09 April 2008 15:33 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Richard,
a) Using the default UML2 resource implementation, UUIDs are used as XMI
identifiers and assigned dynamically as objects are attached to the
resource. If your common based model (and the resource that contains is) is
reconstructed each time it's updated, then yes, the identifiers will change.
b) Yes, the identifiers can be set explicitly (to something more stable) via
the XMLResource#setID(EObject, String) method. This is the approach we use
for the UML2 metamodels and libraries, for example.
c) For an example, see this code from the ConvertModelAction in the examples
plug-in:
protected String setID(EObject eObject) {
Resource eResource = eObject.eResource();
if (eResource instanceof XMIResource) {
XMIResource xmiResource = (XMIResource) eResource;
String id = xmiResource.getID(eObject);
xmiResource.setID(eObject, UML2Util
.getXMIIdentifier((InternalEObject) eObject));
return id;
}
return null;
}
Kenn
"Richard Craddock" <rcraddoc@cisco.com> wrote in message
news:78ea5f7f9f41e606eee19605cbf9284a$1@www.eclipse.org...
> Hi,
>
> I have a number of child projects that are dependant upon a common base.
>
> What I really want to do is :
> Export the common project into an XMI file.
> Export each of the child projects into thier own XMI, each of which
> referneces the common module.
>
> However, each time I create a uml2 output from one of these child
> projects, I appear to have to create a new copy of the common, because the
> references to the common UML module are made using xmi:id values that get
> recreated at each export. This in turn means the common UML is not common
> at all because the references from the other "child" projects no longer
> match.
>
>
> So my question is :
>
> a) Have I understood correctly how the xmi:id is created/used?
> b) If I have, can the xmi:id be set by me to be something unique, yet
> consistent across projects?
> c) If so how can I do this?
>
> Thanks in advance,
>
> Richard
>
>
>
|
|
|
Re: xmi Id in Dependency [message #626382 is a reply to message #477179] |
Wed, 09 April 2008 15:33 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Richard,
a) Using the default UML2 resource implementation, UUIDs are used as XMI
identifiers and assigned dynamically as objects are attached to the
resource. If your common based model (and the resource that contains is) is
reconstructed each time it's updated, then yes, the identifiers will change.
b) Yes, the identifiers can be set explicitly (to something more stable) via
the XMLResource#setID(EObject, String) method. This is the approach we use
for the UML2 metamodels and libraries, for example.
c) For an example, see this code from the ConvertModelAction in the examples
plug-in:
protected String setID(EObject eObject) {
Resource eResource = eObject.eResource();
if (eResource instanceof XMIResource) {
XMIResource xmiResource = (XMIResource) eResource;
String id = xmiResource.getID(eObject);
xmiResource.setID(eObject, UML2Util
.getXMIIdentifier((InternalEObject) eObject));
return id;
}
return null;
}
Kenn
"Richard Craddock" <rcraddoc@cisco.com> wrote in message
news:78ea5f7f9f41e606eee19605cbf9284a$1@www.eclipse.org...
> Hi,
>
> I have a number of child projects that are dependant upon a common base.
>
> What I really want to do is :
> Export the common project into an XMI file.
> Export each of the child projects into thier own XMI, each of which
> referneces the common module.
>
> However, each time I create a uml2 output from one of these child
> projects, I appear to have to create a new copy of the common, because the
> references to the common UML module are made using xmi:id values that get
> recreated at each export. This in turn means the common UML is not common
> at all because the references from the other "child" projects no longer
> match.
>
>
> So my question is :
>
> a) Have I understood correctly how the xmi:id is created/used?
> b) If I have, can the xmi:id be set by me to be something unique, yet
> consistent across projects?
> c) If so how can I do this?
>
> Thanks in advance,
>
> Richard
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02771 seconds