Loading a Profile [message #476951] |
Mon, 18 February 2008 20:02 |
Eclipse User |
|
|
|
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 |
Dave Carlson 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 |
Eclipse User |
|
|
|
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 #626051 is a reply to message #476951] |
Mon, 18 February 2008 20:39 |
Dave Carlson 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 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03978 seconds