Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » XMI attribute lost
XMI attribute lost [message #1073373] Wed, 24 July 2013 12:08 Go to next message
Jesús Muñoz is currently offline Jesús Muñoz
Messages: 7
Registered: July 2013
Junior Member
Hello!

I'm working on a Eclipse plugin to do some M2M and M2T operations. I´m using a acceleo project inside it. I have a M2M transformation(executed with ATL) that generates a *.uml model, the problem is that when it is executed like a Eclipse project it generate a complete model like the following piece of code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="20110701" xmlns:xmi="an url to omg.org/spec/XMI/20110701" xmlns:xsi="an url to w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmlns:utp="an url to ///schemas/utp/_uoEXwIotEeKWU4o6i4Yn9w/0" xsi:schemaLocation="an url to ///schemas/utp/_uoEXwIotEeKWU4o6i4Yn9w/0 Metamodels/utp.uml#_u6Zd4YotEeKWU4o6i4Yn9w">
  <uml:Model xmi:id="_6u2dgPRTEeKvTd0G14kV5g" name="testing_test">
    <elementImport xmi:id="_6u2dgfRTEeKvTd0G14kV5g" alias="System Under Test">


On the other hand, if I execute it like a plugin the same part of the model generated is the next:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" 
xmlns:xmi="an url to www.omg.org/XMI" xmlns:xsi="an url to w3.org/2001/XMLSchema-instance" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmlns:utp="an url to ///schemas/utp/_uoEXwIotEeKWU4o6i4Yn9w/0">
  <uml:Model name="testing_test">
    <elementImport alias="System Under Test">


(I have modified the urls because the restriction)

It seem that don't find the same xmi version, I too notice that in all the elements in the first model(the correct one) appear a xmi:id and/or xmi:type and in the incorrect model only xsi:type without id.

Any suggestions?
Thanks!
Re: XMI attribute lost [message #1074672 is a reply to message #1073373] Sat, 27 July 2013 08:16 Go to previous messageGo to next message
Jesús Muñoz is currently offline Jesús Muñoz
Messages: 7
Registered: July 2013
Junior Member
I´ve solved xmi problem, it was only a problem with the output model path. Now only I have a problem with the xsi:schemaLocation attribute, it only appear when is executed like an Eclipse project but not when I execute it like a plugin. It looks as if doesn´t recognize the profile. What can I do?

Thanks!
Re: XMI attribute lost [message #1074677 is a reply to message #1074672] Sat, 27 July 2013 08:33 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

Whether an xsi:schemaLocation is generated depends on the options map
passed to save(). The relevant XMLResource option is

/**
* Produce an xsi:schemaLocation/xsi:noNamespaceSchemaLocation in the
saved result.
*/
String OPTION_SCHEMA_LOCATION = "SCHEMA_LOCATION";

If you have a custom ResourceFactory, it can provide specific defaults.
You need to look at how your resource is saved.

Regards

Ed Willink

On 27/07/2013 13:16, Jesús Muñoz wrote:
> I´ve solved xmi problem, it was only a problem with the output model
> path. Now only I have a problem with the xsi:schemaLocation attribute,
> it only appear when is executed like an Eclipse project but not when I
> execute it like a plugin. It looks as if doesn´t recognize the
> profile. What can I do?
>
> Thanks!
Re: XMI attribute lost [message #1074999 is a reply to message #1074677] Sun, 28 July 2013 07:32 Go to previous messageGo to next message
Jesús Muñoz is currently offline Jesús Muñoz
Messages: 7
Registered: July 2013
Junior Member
Thanks for your answer Ed.

I´ve tried what you said, I save the model like this:

IExtractor extractor = new EMFExtractor();
extractor.extract(outModel, target, options);


Where options are:

HashMap<String,Object> options = new HashMap<String,Object>();
			options.put("supportUML2Stereotypes", "true");
			options.put("printExecutionTime", "true");
			options.put("allowInterModelReferences", "true");
			options.put("OPTION_SCHEMA_LOCATION", "file:/"+path");


But it doesn´t works. Thank you for your help Ed.
Re: XMI attribute lost [message #1075246 is a reply to message #1074999] Mon, 29 July 2013 01:32 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi<br>
<br>
I write earlier:<br>
<br>
<blockquote>Whether an xsi:schemaLocation is generated depends on
the options map passed to save(). The relevant XMLResource
option is
<br>
<br>
  /**
<br>
   * Produce an xsi:schemaLocation/xsi:noNamespaceSchemaLocation
in the saved result.
<br>
   */
<br>
  String OPTION_SCHEMA_LOCATION = "SCHEMA_LOCATION";
<br>
</blockquote>
<br>
The options are not typed so you must check the type yourself. The
Javadoc doesn;t mention the type explicitly but it really only
gives you two options so it is Boolean.<br>
<br>
It is always good to search for example when unsure. How about the
first search return that I get:<br>
<br>
   
result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION,
Boolean.TRUE);<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
On 28/07/2013 12:32, Jesús Muñoz wrote:<br>
</div>
<blockquote cite="mid:kt2vge$5jp$1@xxxxxxxxe.org" type="cite">Thanks
for your answer Ed.
<br>
<br>
I´ve tried what you said, I save the model like this:
<br>
<br>
<br>
IExtractor extractor = new EMFExtractor();
<br>
extractor.extract(outModel, target, options);
<br>
<br>
<br>
Where options are:
<br>
<br>
<br>
HashMap&lt;String,Object&gt; options = new
HashMap&lt;String,Object&gt;();
<br>
            options.put("supportUML2Stereotypes", "true");
<br>
            options.put("printExecutionTime", "true");
<br>
            options.put("allowInterModelReferences", "true");
<br>
            options.put("OPTION_SCHEMA_LOCATION", <a class="moz-txt-link-rfc2396E" href="file:/">"file:/"</a>+path");
<br>
<br>
<br>
But it doesn´t works. Thank you for your help Ed.
<br>
</blockquote>
<br>
</body>
</html>
Re: XMI attribute lost [message #1075342 is a reply to message #1075246] Mon, 29 July 2013 05:08 Go to previous messageGo to next message
Jesús Muñoz is currently offline Jesús Muñoz
Messages: 7
Registered: July 2013
Junior Member
I´ve debugged and OPTION_SCHEMA_LOCATION option is true by default. Do I have to register the profile or something else?
Re: XMI attribute lost [message #1075601 is a reply to message #1075342] Mon, 29 July 2013 14:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

What profile? We haven't bneen discussing UML have we?

Regards

Ed Willink


On 29/07/2013 10:08, Jesús Muñoz wrote:
> I´ve debugged and OPTION_SCHEMA_LOCATION option is true by default. Do
> I have to register the profile or something else?
Re: XMI attribute lost [message #1075627 is a reply to message #1075601] Mon, 29 July 2013 15:28 Go to previous message
Jesús Muñoz is currently offline Jesús Muñoz
Messages: 7
Registered: July 2013
Junior Member
Hi,

Sorry, some of the tags and attribute lost reference to an UML testing profile. I think that the problem could be when the UML output model is build.
Previous Topic:Control and Object flow in Activity Model
Next Topic:Simply API for saving UML2 models and associated Profile/Stereotype values
Goto Forum:
  


Current Time: Thu Jul 31 21:45:03 EDT 2014

Powered by FUDForum. Page generated in 0.02416 seconds