Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Loading a Profile
Loading a Profile [message #476951] Mon, 18 February 2008 20:02 Go to next message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

Hi,
I am trying to load a standard profile into my model, but although I am
being able to get the resource (resourceSet.getResource) I can not get the
profile out of it (EcoreUtil.getObjectByType); it returns null.
Since the profile I am reading was created using UML 2.0, I believe the
migration rules don't apply, am I right ? Assuming the previous assertion
is true, the code to read the profile should be similiar to the one in the
document "Introduction to UML2 Profiles", which is my case. My code is:
URI uri =
URI.createURI(" file:/C:\\UML_Profile_for_Schedulabilty,_Performance_and_Tim e_Specification.profile.uml ");

Resource res = RESOURCE_SET.getResource(uri, true);

prof=(org.eclipse.uml2.uml.Profile) EcoreUtil.getObjectByType(
res.getContents(), UMLPackage.Literals.PACKAGE);

The profile that I am trying to read is Standard Profile for
Schedulability, Performance and Time Specification and it was created by
OMG.
Any ideas ?

-Flávio
Re: Loading a Profile [message #476952 is a reply to message #476951] Mon, 18 February 2008 20:39 Go to previous messageGo to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
If your profile was created using UML 2.0, then I assume it should be a
..uml2 model file for Eclipse UML2 (not .uml file). I encountered this
before, needing to migrate a .uml2 profile. Try opening your .uml2 profile
using the UML2 project sample editor -- it will automatically migrate to
..uml then save the .uml file. Now use the migratied .uml profile in your
application.

Cheers,
Dave Carlson

"Flavio Duarte" <flavio.p.duarte@gmail.com> wrote in message
news:97e76723b0c70ed46412e3e366d883e1$1@www.eclipse.org...
> Hi,
> I am trying to load a standard profile into my model, but although I am
> being able to get the resource (resourceSet.getResource) I can not get the
> profile out of it (EcoreUtil.getObjectByType); it returns null.
> Since the profile I am reading was created using UML 2.0, I believe the
> migration rules don't apply, am I right ? Assuming the previous assertion
> is true, the code to read the profile should be similiar to the one in the
> document "Introduction to UML2 Profiles", which is my case. My code is:
> URI uri =
> URI.createURI(" file:/C:\\UML_Profile_for_Schedulabilty,_Performance_and_Tim e_Specification.profile.uml ");
>
> Resource res = RESOURCE_SET.getResource(uri, true);
>
> prof=(org.eclipse.uml2.uml.Profile) EcoreUtil.getObjectByType(
> res.getContents(), UMLPackage.Literals.PACKAGE);
>
> The profile that I am trying to read is Standard Profile for
> Schedulability, Performance and Time Specification and it was created by
> OMG.
> Any ideas ?
>
> -Fl
Re: Loading a Profile [message #476959 is a reply to message #476952] Wed, 20 February 2008 21:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

Dave Carlson,
It seems that your hack worked but I still have two questions:
1 - Is there a way to do it programmatically ?
2 - How did you discovered it ?

thanks,
Flávio
Re: Loading a Profile [message #476961 is a reply to message #476959] Wed, 20 February 2008 23:31 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Hi Fl
Re: Loading a Profile [message #626051 is a reply to message #476951] Mon, 18 February 2008 20:39 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
If your profile was created using UML 2.0, then I assume it should be a
..uml2 model file for Eclipse UML2 (not .uml file). I encountered this
before, needing to migrate a .uml2 profile. Try opening your .uml2 profile
using the UML2 project sample editor -- it will automatically migrate to
..uml then save the .uml file. Now use the migratied .uml profile in your
application.

Cheers,
Dave Carlson

"Flavio Duarte" <flavio.p.duarte@gmail.com> wrote in message
news:97e76723b0c70ed46412e3e366d883e1$1@www.eclipse.org...
> Hi,
> I am trying to load a standard profile into my model, but although I am
> being able to get the resource (resourceSet.getResource) I can not get the
> profile out of it (EcoreUtil.getObjectByType); it returns null.
> Since the profile I am reading was created using UML 2.0, I believe the
> migration rules don't apply, am I right ? Assuming the previous assertion
> is true, the code to read the profile should be similiar to the one in the
> document "Introduction to UML2 Profiles", which is my case. My code is:
> URI uri =
> URI.createURI(" file:/C:\\UML_Profile_for_Schedulabilty,_Performance_and_Tim e_Specification.profile.uml ");
>
> Resource res = RESOURCE_SET.getResource(uri, true);
>
> prof=(org.eclipse.uml2.uml.Profile) EcoreUtil.getObjectByType(
> res.getContents(), UMLPackage.Literals.PACKAGE);
>
> The profile that I am trying to read is Standard Profile for
> Schedulability, Performance and Time Specification and it was created by
> OMG.
> Any ideas ?
>
> -Fl
Re: Loading a Profile [message #626058 is a reply to message #476952] Wed, 20 February 2008 21:49 Go to previous message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

Dave Carlson,
It seems that your hack worked but I still have two questions:
1 - Is there a way to do it programmatically ?
2 - How did you discovered it ?

thanks,
Flávio
Re: Loading a Profile [message #626060 is a reply to message #476959] Wed, 20 February 2008 23:31 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Hi Fl
Previous Topic:stereotypes with MagicDraw
Next Topic:[Announce] MDT UML2 2.2.0 I200802201750 is available
Goto Forum:
  


Current Time: Thu Mar 28 22:45:30 GMT 2024

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

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

Back to the top