Skip to main content



      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 11:00 Go to next message
Eclipse UserFriend
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] Sat, 03 March 2007 21:10 Go to previous message
Eclipse UserFriend
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] Sat, 03 March 2007 21:10 Go to previous message
Eclipse UserFriend
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: Mon Apr 14 18:48:03 EDT 2025

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

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

Back to the top