Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Property-Type from a inter-moded reference can't be correctly resolved?
Property-Type from a inter-moded reference can't be correctly resolved? [message #477101] Tue, 18 March 2008 10:40 Go to next message
Jinhui is currently offline JinhuiFriend
Messages: 42
Registered: July 2009
Member
Hi everyone,

I am using RSA7, and having a problem about how to get the type-name of a
property, which is a reference to a class in another model(the
"modelLibrary").
like following:

M1 (M1.emx)
|--Class1
|--attr1 (type: M2.Integer)

M2(M2.emx, defined as a ModelLibrary in RSA7)
|--Integer

I want to get the name of type of "attr1" (i.e. it should be "Integer"),
but using the following code snippet, I can't get the type of the
Property, the type of the property attr1 is a Proxy without much
information, not even the name.

Class c = (Class)entityPkg.getPackagedElement("Class1");
for(Iterator iter = c.getOwnedAttributes().iterator(); iter.hasNext();) {
Property p = (Property)iter.next();
System.out.println("Property name : " + p.getName() + ", type : " +
p.getType().getName());
}

type information from the debug session:

org.eclipse.uml2.uml.internal.impl.ClassImpl@67886788 (eProxyURI:
platform:/resource/EvaluationTestModel/libs/M2.emx#_Ktwuva7K EdqP-KXzb5-4Sg?M2/Integer?)

Further inspecting this type, I found that almost everything is null,
except for the eProxyURI. I guess this is because this Proxy is not
resolved, right?

So my question is how can I resolve this proxy and get the name of the
type.

Any help would be greatly appreciated.
Regards!
Jinhui
Re: Property-Type from a inter-moded reference can't be correctly resolved? [message #477102 is a reply to message #477101] Tue, 18 March 2008 12:39 Go to previous message
Jinhui is currently offline JinhuiFriend
Messages: 42
Registered: July 2009
Member
Hi

I got it: there was some problem with the links between the models.

the reason:

My model was not created from scratch, and previously it used an old model
library, now I changed this model, and imported the same library from a
different project, and when I set the type to a class in the model
library, RSA mistakenly took the old one as the destination, which caused
all the problems.

After reimport the library and set the type to a class in the new library,
the problem is gone. the proxies are automatically resolved.

sorry for the annoying posts.

best regards!

Jinhui
Re: Property-Type from a inter-moded reference can't be correctly resolved? [message #626231 is a reply to message #477101] Tue, 18 March 2008 12:39 Go to previous message
Jinhui is currently offline JinhuiFriend
Messages: 42
Registered: July 2009
Member
Hi

I got it: there was some problem with the links between the models.

the reason:

My model was not created from scratch, and previously it used an old model
library, now I changed this model, and imported the same library from a
different project, and when I set the type to a class in the model
library, RSA mistakenly took the old one as the destination, which caused
all the problems.

After reimport the library and set the type to a class in the new library,
the problem is gone. the proxies are automatically resolved.

sorry for the annoying posts.

best regards!

Jinhui
Previous Topic:Property-Type from a inter-moded reference can't be correctly resolved?
Next Topic:Primitive Types - UML to EMF Generation
Goto Forum:
  


Current Time: Fri Apr 19 23:20:13 GMT 2024

Powered by FUDForum. Page generated in 0.02844 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top