Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » [UML2] Unable to load profile file
[UML2] Unable to load profile file [message #376854] Tue, 27 February 2007 16:00 Go to next message
Paul Gribben is currently offline Paul GribbenFriend
Messages: 28
Registered: July 2009
Junior Member
Hello,

I've just started using the eclipse UML2 software (v2.0.2). I have
successfully generated a UML profile and written to file, but cannot now
load that file into a program as a UML profile.

Here's how I'm attempting to load it in:

ResourceSet RESOURCE_SET = new ResourceSetImpl();
Resource resource = RESOURCE_SET.getResource(uri, false);
_profile =
(org.eclipse.uml2.uml.Profile)EcoreUtil.
getObjectByType(resource.getContents(),
UMLPackage.Literals.PACKAGE);


.. null value is always returned by EcoreUtil.getObjectByType(..)
Re: [UML2] Unable to load profile file [message #376855 is a reply to message #376854] Sun, 04 March 2007 02:10 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Paul,

Have you read the "Introduction to UML2 Profiles" article
( http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html)?
It explains how to work with models and profiles, both progammatically and
via the UI. In particular, you'll need to ensure that you've registered the
required packages, resource factories, and pathmaps, as outlined in the FAQ
( http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_requ ired_to_load_a_UML_.28.uml.29_resource_from_a_standalone_app lication.3F)
- assuming you're running standalone.

Kenn

"Paul Gribben" <paul.gribben@gmail.com> wrote in message
news:9000b07c511dff4a12cbf1ac859084c7$1@www.eclipse.org...
> Hello,
>
> I've just started using the eclipse UML2 software (v2.0.2). I have
> successfully generated a UML profile and written to file, but cannot now
> load that file into a program as a UML profile.
>
> Here's how I'm attempting to load it in:
>
> ResourceSet RESOURCE_SET = new ResourceSetImpl();
> Resource resource = RESOURCE_SET.getResource(uri, false);
> _profile =
> (org.eclipse.uml2.uml.Profile)EcoreUtil.
> getObjectByType(resource.getContents(),
> UMLPackage.Literals.PACKAGE);
>
>
> . null value is always returned by EcoreUtil.getObjectByType(..)
>
Re: [UML2] Unable to load profile file [message #570727 is a reply to message #376854] Sun, 04 March 2007 02:10 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Paul,

Have you read the "Introduction to UML2 Profiles" article
( http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html)?
It explains how to work with models and profiles, both progammatically and
via the UI. In particular, you'll need to ensure that you've registered the
required packages, resource factories, and pathmaps, as outlined in the FAQ
( http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_requ ired_to_load_a_UML_.28.uml.29_resource_from_a_standalone_app lication.3F)
- assuming you're running standalone.

Kenn

"Paul Gribben" <paul.gribben@gmail.com> wrote in message
news:9000b07c511dff4a12cbf1ac859084c7$1@www.eclipse.org...
> Hello,
>
> I've just started using the eclipse UML2 software (v2.0.2). I have
> successfully generated a UML profile and written to file, but cannot now
> load that file into a program as a UML profile.
>
> Here's how I'm attempting to load it in:
>
> ResourceSet RESOURCE_SET = new ResourceSetImpl();
> Resource resource = RESOURCE_SET.getResource(uri, false);
> _profile =
> (org.eclipse.uml2.uml.Profile)EcoreUtil.
> getObjectByType(resource.getContents(),
> UMLPackage.Literals.PACKAGE);
>
>
> . null value is always returned by EcoreUtil.getObjectByType(..)
>
Previous Topic:[UML2] Unable to load profile file
Next Topic:Installing/Using Tools
Goto Forum:
  


Current Time: Fri Mar 29 07:05:15 GMT 2024

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

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

Back to the top