Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Cannot load applied profiles
Cannot load applied profiles [message #477478] Tue, 03 June 2008 13:26 Go to next message
idir is currently offline idirFriend
Messages: 4
Registered: July 2009
Junior Member
Hi all,
I am developping an Eclipse plugin which manipulates UML/MARTE models in
order to apply several stereotypes from MARTE subprofiles.
I created a simple UML model with RSA, then I applied the MARTE profile on
it and exported the model as a .uml file.
The code I wrote previously could load the model (I followed the
"Introduction to UML2 Profiles" tutorial), and each stereotype in the
different profiles, and I could then apply them to any OwnedElement of my
model.

I created another plugin project, which now allows the user to select the
target model to manipulate. The code is exactly the same but now when
loading the model, every MARTE subprofile ( HRM, GRM, Alloc, ... ) appears
as "null".

The imports and dependancies are exactly the same, the model I load is the
same aswell, I cannot see how to solve that issue.

Here is my simple model :

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:HRM="http:///schemas/HRM/_JXoYQHr_EdyPbMD1sPyR5w/22"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
xsi:schemaLocation="http:///schemas/HRM/_JXoYQHr_EdyPbMD1sPyR5w/22
MARTE_HRM.profile.uml#_6v8GNiNFEd2Nn_pBZEuBUg">
<uml:Model xmi:id="_6vVrNCNFEd2Nn_pBZEuBUg" name="Blank Model">
<packageImport xmi:id="_6vVrNSNFEd2Nn_pBZEuBUg">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
<packagedElement xmi:type="uml:Class" xmi:id="_6vVrNiNFEd2Nn_pBZEuBUg"
name="IntelPentium"/>
<packagedElement xmi:type="uml:Class" xmi:id="_6vVrNyNFEd2Nn_pBZEuBUg"
name="AMD"/>
<packagedElement xmi:type="uml:Class" xmi:id="_6vVrOCNFEd2Nn_pBZEuBUg"
name="IntelMMX"/>
<packagedElement xmi:type="uml:Class" xmi:id="_6vVrOSNFEd2Nn_pBZEuBUg"
name="MaRam1"/>
<packagedElement xmi:type="uml:Class" xmi:id="_6vVrOiNFEd2Nn_pBZEuBUg"
name="MaRam2"/>
<packagedElement xmi:type="uml:Class" xmi:id="_6vVrOyNFEd2Nn_pBZEuBUg"
name="MonBusBis"/>
<packagedElement xmi:type="uml:Class" xmi:id="_6vVrPCNFEd2Nn_pBZEuBUg"
name="monBus 300Mhz"/>
<profileApplication xmi:id="_6vVrPSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrPiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
</eAnnotations>
<appliedProfile
href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
</profileApplication>
<profileApplication xmi:id="_6vVrPyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrQCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="Default.profile.uml#_6vyVCCNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile href="Default.profile.uml#_6vyVBiNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrQSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrQiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="Deployment.profile.uml#_6u4_CSNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="Deployment.profile.uml#_6u4_ByNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrQyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrRCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_Alloc.profile.uml#_6wFQ1yNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_Alloc.profile.uml#_6wFQ1SNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrRSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrRiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_GCM.profile.uml#_6wFRxCNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_GCM.profile.uml#_6wFRwiNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrRyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrSCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_GQAM.profile.uml#_6vMiJSNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_GQAM.profile.uml#_6vMiIyNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrSSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrSiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_GRM.profile.uml#_6umCbiNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_GRM.profile.uml#_6umCbCNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrSyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrTCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_HRM.profile.uml#_6v8GNiNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_HRM.profile.uml#_6v8GNCNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrTSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrTiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" MARTE_InternalMarteLibrary.profile.uml#_6vfZjSNFEd2Nn_pBZEuB Ug "/>
</eAnnotations>
<appliedProfile
href=" MARTE_InternalMarteLibrary.profile.uml#_6vfZiyNFEd2Nn_pBZEuB Ug "/>
</profileApplication>
<profileApplication xmi:id="_6vVrTyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrUCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_NFPs.profile.uml#_6ucQliNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_NFPs.profile.uml#_6ucQlCNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrUSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrUiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_PAM.profile.uml#_6volziNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_PAM.profile.uml#_6volzCNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrUyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrVCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_RSM.profile.uml#_6wO_9iNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_RSM.profile.uml#_6wO_9CNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrVSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrViNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_RTEMoCC.profile.uml#_6vCuiyNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_RTEMoCC.profile.uml#_6vCuiSNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrVyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrWCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_SAM.profile.uml#_6vfcsiNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_SAM.profile.uml#_6vfcsCNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrWSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrWiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_SRM.profile.uml#_6uv04SNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_SRM.profile.uml#_6uv03yNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrWyNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrXCNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_Time.profile.uml#_6vCxBSNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_Time.profile.uml#_6vCxAyNFEd2Nn_pBZEuBUg"/>
</profileApplication>
<profileApplication xmi:id="_6vVrXSNFEd2Nn_pBZEuBUg">
<eAnnotations xmi:id="_6vVrXiNFEd2Nn_pBZEuBUg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="MARTE_VSL.profile.uml#_6ucRdSNFEd2Nn_pBZEuBUg"/>
</eAnnotations>
<appliedProfile
href="MARTE_VSL.profile.uml#_6ucRcyNFEd2Nn_pBZEuBUg"/>
</profileApplication>
</uml:Model>
<HRM:HwBus xmi:id="_6vVrXyNFEd2Nn_pBZEuBUg"
base_Classifier="_6vVrPCNFEd2Nn_pBZEuBUg"/>
<HRM:HwRAM xmi:id="_6vVrYCNFEd2Nn_pBZEuBUg"
base_Classifier="_6vVrOSNFEd2Nn_pBZEuBUg"/>
<HRM:HwRAM xmi:id="_6vVrYSNFEd2Nn_pBZEuBUg"
base_Classifier="_6vVrOiNFEd2Nn_pBZEuBUg"/>
<HRM:HwProcessor xmi:id="_6vVrYiNFEd2Nn_pBZEuBUg"
base_Classifier="_6vVrNiNFEd2Nn_pBZEuBUg"/>
<HRM:HwProcessor xmi:id="_6vVrYyNFEd2Nn_pBZEuBUg"
base_Classifier="_6vVrNyNFEd2Nn_pBZEuBUg"/>
<HRM:HwProcessor xmi:id="_6vVrZCNFEd2Nn_pBZEuBUg"
base_Classifier="_6vVrOCNFEd2Nn_pBZEuBUg"/>
<HRM:HwBus xmi:id="_6vVrZSNFEd2Nn_pBZEuBUg"
base_Classifier="_6vVrOyNFEd2Nn_pBZEuBUg"/>
</xmi:XMI>

Here is the way the model is loaded ( in both versions ) :
protected static org.eclipse.uml2.uml.Model load1(URI uri) {

org.eclipse.uml2.uml.Model model_ = null;
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "*",
new XMIResourceFactoryImpl());

try {
Resource resource2 = new ResourceSetImpl().getResource(uri, true);

model_ = (org.eclipse.uml2.uml.Model) EcoreUtil
.getObjectByType(resource2.getContents(),
UMLPackage.Literals.ELEMENT);
System.out.println(resource2.getContents());
} catch (WrappedException we) {
err(we.getMessage());
System.exit(1);
}

return model_;




Thank you for any help.

Idir
Re: Cannot load applied profiles [message #477501 is a reply to message #477478] Tue, 10 June 2008 15:20 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi idir,

You may need to use a URI converter to ensure that your environment can
properly locate your profiles. You can use the EMF extension point or
register them directly.
Have a look at the posting "[Stereotype] isAppliedStereotype differs on
JavaDoc and Implementation" from April 30, 2008 8:01 AM by Gunther.

Cheers
- James.

"idir" <idir.haddadi@DOMAIN.HIDDEN> wrote in message
news:3c9cb5e10b68ba39cdf4094aa01b23c9$1@www.eclipse.org...
> Hi all,
> I am developping an Eclipse plugin which manipulates UML/MARTE models in
> order to apply several stereotypes from MARTE subprofiles.
> I created a simple UML model with RSA, then I applied the MARTE profile on
> it and exported the model as a .uml file.
> The code I wrote previously could load the model (I followed the
> "Introduction to UML2 Profiles" tutorial), and each stereotype in the
> different profiles, and I could then apply them to any OwnedElement of my
> model.
>
> I created another plugin project, which now allows the user to select the
> target model to manipulate. The code is exactly the same but now when
> loading the model, every MARTE subprofile ( HRM, GRM, Alloc, ... ) appears
> as "null".
>
> The imports and dependancies are exactly the same, the model I load is the
> same aswell, I cannot see how to solve that issue.
>
> Here is my simple model :
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:HRM="http:///schemas/HRM/_JXoYQHr_EdyPbMD1sPyR5w/22"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xsi:schemaLocation="http:///schemas/HRM/_JXoYQHr_EdyPbMD1sPyR5w/22
> MARTE_HRM.profile.uml#_6v8GNiNFEd2Nn_pBZEuBUg">
> <uml:Model xmi:id="_6vVrNCNFEd2Nn_pBZEuBUg" name="Blank Model">
> <packageImport xmi:id="_6vVrNSNFEd2Nn_pBZEuBUg">
> <importedPackage xmi:type="uml:Model"
> href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
> </packageImport>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrNiNFEd2Nn_pBZEuBUg"
> name="IntelPentium"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrNyNFEd2Nn_pBZEuBUg"
> name="AMD"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOCNFEd2Nn_pBZEuBUg"
> name="IntelMMX"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOSNFEd2Nn_pBZEuBUg"
> name="MaRam1"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOiNFEd2Nn_pBZEuBUg"
> name="MaRam2"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOyNFEd2Nn_pBZEuBUg"
> name="MonBusBis"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrPCNFEd2Nn_pBZEuBUg"
> name="monBus 300Mhz"/>
> <profileApplication xmi:id="_6vVrPSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrPiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
> </eAnnotations>
> <appliedProfile
> href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrPyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrQCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="Default.profile.uml#_6vyVCCNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile href="Default.profile.uml#_6vyVBiNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrQSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrQiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="Deployment.profile.uml#_6u4_CSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="Deployment.profile.uml#_6u4_ByNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrQyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrRCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_Alloc.profile.uml#_6wFQ1yNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_Alloc.profile.uml#_6wFQ1SNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrRSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrRiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_GCM.profile.uml#_6wFRxCNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_GCM.profile.uml#_6wFRwiNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrRyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrSCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_GQAM.profile.uml#_6vMiJSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_GQAM.profile.uml#_6vMiIyNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrSSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrSiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_GRM.profile.uml#_6umCbiNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_GRM.profile.uml#_6umCbCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrSyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrTCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_HRM.profile.uml#_6v8GNiNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_HRM.profile.uml#_6v8GNCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrTSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrTiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" MARTE_InternalMarteLibrary.profile.uml#_6vfZjSNFEd2Nn_pBZEuB Ug "/>
> </eAnnotations>
> <appliedProfile
> href=" MARTE_InternalMarteLibrary.profile.uml#_6vfZiyNFEd2Nn_pBZEuB Ug "/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrTyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrUCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_NFPs.profile.uml#_6ucQliNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_NFPs.profile.uml#_6ucQlCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrUSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrUiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_PAM.profile.uml#_6volziNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_PAM.profile.uml#_6volzCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrUyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrVCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_RSM.profile.uml#_6wO_9iNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_RSM.profile.uml#_6wO_9CNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrVSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrViNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_RTEMoCC.profile.uml#_6vCuiyNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_RTEMoCC.profile.uml#_6vCuiSNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrVyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrWCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_SAM.profile.uml#_6vfcsiNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_SAM.profile.uml#_6vfcsCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrWSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrWiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_SRM.profile.uml#_6uv04SNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_SRM.profile.uml#_6uv03yNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrWyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrXCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_Time.profile.uml#_6vCxBSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_Time.profile.uml#_6vCxAyNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrXSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrXiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_VSL.profile.uml#_6ucRdSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_VSL.profile.uml#_6ucRcyNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> </uml:Model>
> <HRM:HwBus xmi:id="_6vVrXyNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrPCNFEd2Nn_pBZEuBUg"/>
> <HRM:HwRAM xmi:id="_6vVrYCNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOSNFEd2Nn_pBZEuBUg"/>
> <HRM:HwRAM xmi:id="_6vVrYSNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOiNFEd2Nn_pBZEuBUg"/>
> <HRM:HwProcessor xmi:id="_6vVrYiNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrNiNFEd2Nn_pBZEuBUg"/>
> <HRM:HwProcessor xmi:id="_6vVrYyNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrNyNFEd2Nn_pBZEuBUg"/>
> <HRM:HwProcessor xmi:id="_6vVrZCNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOCNFEd2Nn_pBZEuBUg"/>
> <HRM:HwBus xmi:id="_6vVrZSNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOyNFEd2Nn_pBZEuBUg"/>
> </xmi:XMI>
>
> Here is the way the model is loaded ( in both versions ) : protected
> static org.eclipse.uml2.uml.Model load1(URI uri) {
>
> org.eclipse.uml2.uml.Model model_ = null;
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "*",
> new XMIResourceFactoryImpl());
> try {
> Resource resource2 = new ResourceSetImpl().getResource(uri, true);
>
> model_ = (org.eclipse.uml2.uml.Model) EcoreUtil
> .getObjectByType(resource2.getContents(),
> UMLPackage.Literals.ELEMENT);
> System.out.println(resource2.getContents());
> } catch (WrappedException we) {
> err(we.getMessage());
> System.exit(1);
> }
>
> return model_;
>
>
>
>
> Thank you for any help.
>
> Idir
>
Re: Cannot load applied profiles [message #477515 is a reply to message #477478] Fri, 13 June 2008 14:52 Go to previous message
idir is currently offline idirFriend
Messages: 4
Registered: July 2009
Junior Member
Ok, thank you james.
Re: Cannot load applied profiles [message #626691 is a reply to message #477478] Tue, 10 June 2008 15:20 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi idir,

You may need to use a URI converter to ensure that your environment can
properly locate your profiles. You can use the EMF extension point or
register them directly.
Have a look at the posting "[Stereotype] isAppliedStereotype differs on
JavaDoc and Implementation" from April 30, 2008 8:01 AM by Gunther.

Cheers
- James.

"idir" <idir.haddadi@DOMAIN.HIDDEN> wrote in message
news:3c9cb5e10b68ba39cdf4094aa01b23c9$1@www.eclipse.org...
> Hi all,
> I am developping an Eclipse plugin which manipulates UML/MARTE models in
> order to apply several stereotypes from MARTE subprofiles.
> I created a simple UML model with RSA, then I applied the MARTE profile on
> it and exported the model as a .uml file.
> The code I wrote previously could load the model (I followed the
> "Introduction to UML2 Profiles" tutorial), and each stereotype in the
> different profiles, and I could then apply them to any OwnedElement of my
> model.
>
> I created another plugin project, which now allows the user to select the
> target model to manipulate. The code is exactly the same but now when
> loading the model, every MARTE subprofile ( HRM, GRM, Alloc, ... ) appears
> as "null".
>
> The imports and dependancies are exactly the same, the model I load is the
> same aswell, I cannot see how to solve that issue.
>
> Here is my simple model :
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:HRM="http:///schemas/HRM/_JXoYQHr_EdyPbMD1sPyR5w/22"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xsi:schemaLocation="http:///schemas/HRM/_JXoYQHr_EdyPbMD1sPyR5w/22
> MARTE_HRM.profile.uml#_6v8GNiNFEd2Nn_pBZEuBUg">
> <uml:Model xmi:id="_6vVrNCNFEd2Nn_pBZEuBUg" name="Blank Model">
> <packageImport xmi:id="_6vVrNSNFEd2Nn_pBZEuBUg">
> <importedPackage xmi:type="uml:Model"
> href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
> </packageImport>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrNiNFEd2Nn_pBZEuBUg"
> name="IntelPentium"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrNyNFEd2Nn_pBZEuBUg"
> name="AMD"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOCNFEd2Nn_pBZEuBUg"
> name="IntelMMX"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOSNFEd2Nn_pBZEuBUg"
> name="MaRam1"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOiNFEd2Nn_pBZEuBUg"
> name="MaRam2"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrOyNFEd2Nn_pBZEuBUg"
> name="MonBusBis"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_6vVrPCNFEd2Nn_pBZEuBUg"
> name="monBus 300Mhz"/>
> <profileApplication xmi:id="_6vVrPSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrPiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
> </eAnnotations>
> <appliedProfile
> href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrPyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrQCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="Default.profile.uml#_6vyVCCNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile href="Default.profile.uml#_6vyVBiNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrQSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrQiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="Deployment.profile.uml#_6u4_CSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="Deployment.profile.uml#_6u4_ByNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrQyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrRCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_Alloc.profile.uml#_6wFQ1yNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_Alloc.profile.uml#_6wFQ1SNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrRSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrRiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_GCM.profile.uml#_6wFRxCNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_GCM.profile.uml#_6wFRwiNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrRyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrSCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_GQAM.profile.uml#_6vMiJSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_GQAM.profile.uml#_6vMiIyNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrSSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrSiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_GRM.profile.uml#_6umCbiNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_GRM.profile.uml#_6umCbCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrSyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrTCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_HRM.profile.uml#_6v8GNiNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_HRM.profile.uml#_6v8GNCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrTSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrTiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" MARTE_InternalMarteLibrary.profile.uml#_6vfZjSNFEd2Nn_pBZEuB Ug "/>
> </eAnnotations>
> <appliedProfile
> href=" MARTE_InternalMarteLibrary.profile.uml#_6vfZiyNFEd2Nn_pBZEuB Ug "/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrTyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrUCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_NFPs.profile.uml#_6ucQliNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_NFPs.profile.uml#_6ucQlCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrUSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrUiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_PAM.profile.uml#_6volziNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_PAM.profile.uml#_6volzCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrUyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrVCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_RSM.profile.uml#_6wO_9iNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_RSM.profile.uml#_6wO_9CNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrVSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrViNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_RTEMoCC.profile.uml#_6vCuiyNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_RTEMoCC.profile.uml#_6vCuiSNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrVyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrWCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_SAM.profile.uml#_6vfcsiNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_SAM.profile.uml#_6vfcsCNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrWSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrWiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_SRM.profile.uml#_6uv04SNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_SRM.profile.uml#_6uv03yNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrWyNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrXCNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_Time.profile.uml#_6vCxBSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_Time.profile.uml#_6vCxAyNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> <profileApplication xmi:id="_6vVrXSNFEd2Nn_pBZEuBUg">
> <eAnnotations xmi:id="_6vVrXiNFEd2Nn_pBZEuBUg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="MARTE_VSL.profile.uml#_6ucRdSNFEd2Nn_pBZEuBUg"/>
> </eAnnotations>
> <appliedProfile
> href="MARTE_VSL.profile.uml#_6ucRcyNFEd2Nn_pBZEuBUg"/>
> </profileApplication>
> </uml:Model>
> <HRM:HwBus xmi:id="_6vVrXyNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrPCNFEd2Nn_pBZEuBUg"/>
> <HRM:HwRAM xmi:id="_6vVrYCNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOSNFEd2Nn_pBZEuBUg"/>
> <HRM:HwRAM xmi:id="_6vVrYSNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOiNFEd2Nn_pBZEuBUg"/>
> <HRM:HwProcessor xmi:id="_6vVrYiNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrNiNFEd2Nn_pBZEuBUg"/>
> <HRM:HwProcessor xmi:id="_6vVrYyNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrNyNFEd2Nn_pBZEuBUg"/>
> <HRM:HwProcessor xmi:id="_6vVrZCNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOCNFEd2Nn_pBZEuBUg"/>
> <HRM:HwBus xmi:id="_6vVrZSNFEd2Nn_pBZEuBUg"
> base_Classifier="_6vVrOyNFEd2Nn_pBZEuBUg"/>
> </xmi:XMI>
>
> Here is the way the model is loaded ( in both versions ) : protected
> static org.eclipse.uml2.uml.Model load1(URI uri) {
>
> org.eclipse.uml2.uml.Model model_ = null;
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "*",
> new XMIResourceFactoryImpl());
> try {
> Resource resource2 = new ResourceSetImpl().getResource(uri, true);
>
> model_ = (org.eclipse.uml2.uml.Model) EcoreUtil
> .getObjectByType(resource2.getContents(),
> UMLPackage.Literals.ELEMENT);
> System.out.println(resource2.getContents());
> } catch (WrappedException we) {
> err(we.getMessage());
> System.exit(1);
> }
>
> return model_;
>
>
>
>
> Thank you for any help.
>
> Idir
>
Re: Cannot load applied profiles [message #626705 is a reply to message #477478] Fri, 13 June 2008 14:52 Go to previous message
idir is currently offline idirFriend
Messages: 4
Registered: July 2009
Junior Member
Ok, thank you james.
Previous Topic:Sterotypes
Next Topic:Creating a UML Editor
Goto Forum:
  


Current Time: Mon Jun 18 11:58:32 GMT 2018

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

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

Back to the top