Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Check profile application(No successful check because of different namespace uris when saving models?)
Check profile application [message #875370] Tue, 22 May 2012 16:01 Go to next message
Tex Iano is currently offline Tex IanoFriend
Messages: 99
Registered: February 2012

I have created a UML model programmatically. The model is saved as file and contains a profile application.

Now I want to realize the loading of models: For this purpose I load the model, then I load my profile from file and check whether the profile is applied. Because if not, the profile is expected to be applied.

Well, now my problem is, that the check whether my profile is applied does not work.

		if (!model.isProfileApplied(myProfile)) {
			System.out.println("Profile not applied");
			applyProfile(model, myProfile);

My profile is never applied according to this check Smile (Of course within the file it is added).

However, I assume there is some problem concerning the namespace uri. Because every time I save my model the profile gets a new namespace uri:

Here are some examples of the top of my models:

<xmi:XMI xmi:version="2.1" xmlns:xmi="" xmlns:xsi="" xmlns:My="http:///schemas/My/_D1CfgKQmEeGs79gf9MX0Ow/0" xmlns:ecore="" xmlns:uml="" xsi:schemaLocation="http:///schemas/My/_D1CfgKQmEeGs79gf9MX0Ow/0 file:/C:/...location...myProfile.uml">

Another file:

<xmi:XMI xmi:version="2.1" xmlns:xmi="" xmlns:xsi="" xmlns:My="http:///schemas/My/_KifO8KQmEeGs79gf9MX0Ow/0" xmlns:ecore="" xmlns:uml="" xsi:schemaLocation="http:///schemas/My/_KifO8KQmEeGs79gf9MX0Ow/0 file:/C:/...location...myProfile.uml">

So the namespace uri is different every time. Do you have any idea why the namespace is not identical?

Within the profile I have set the namespace uri:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Profile xmi:version="2.1" xmlns:xmi="" xmlns:xsi="" xmlns:ecore="" xmlns:uml="" xmi:id="_bO2YlM0cEd6AF7oF64guDA" name="MyProfile">
  <eAnnotations xmi:id="_Ap4f4FAYEeGaQIAuFv90zA" source="">
    <contents xsi:type="ecore:EPackage" name="My" nsURI="http://www.etc./My" nsPrefix="My">

I have checked to load and save the profile. And also in this case, the NS Uri is reset to a random value.


Re: Check profile application [message #875858 is a reply to message #875370] Wed, 23 May 2012 13:09 Go to previous message
Tex Iano is currently offline Tex IanoFriend
Messages: 99
Registered: February 2012
Maaaaaaan Smile The solution: I did always a profile.define() before applying it. This changed the namespace uri.

So: If you already have a working profile, don't do a define Smile
Previous Topic:Store model in database
Next Topic:Make UML profile plug-in visible
Goto Forum:

Current Time: Sun May 27 01:38:58 GMT 2018

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

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

Back to the top