Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » XMI IDs in external program
XMI IDs in external program [message #897571] Tue, 24 July 2012 14:36 Go to next message
Guillaume Mockly is currently offline Guillaume Mockly
Messages: 3
Registered: March 2012
Junior Member
Hello

I ran into a problem while writing a Java program which uses ATL to make a transformation to UML.

Here is the content of a transformation result:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http//www.omg.org/XMI" xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" xmlns:uml="http//www.eclipse.org/uml2/3.0.0/UML">
  <uml:Model name="pattern">
    <packagedElement xsi:type="uml:Package" name="interfaces">
      <packagedElement xsi:type="uml:Interface" name="if1">
        <ownedOperation name="op1"/>
      </packagedElement>
      <packagedElement xsi:type="uml:Interface" name="if2">
        <ownedOperation name="op2"/>
      </packagedElement>
      <packagedElement xsi:type="uml:Interface" name="if3">
        <ownedOperation name="op3"/>
      </packagedElement>
    </packagedElement>
  </uml:Model>
  <uml:Class name="test" clientDependency="/1/@interfaceRealization.0 /1/@interfaceRealization.1 /1/@interfaceRealization.2">
    <interfaceRealization supplier="/0/interfaces/if1" client="/1" contract="/0/interfaces/if1"/>
    <interfaceRealization supplier="/0/interfaces/if2" client="/1" contract="/0/interfaces/if2"/>
    <interfaceRealization supplier="/0/interfaces/if3" client="/1" contract="/0/interfaces/if3"/>
  </uml:Class>
</xmi:XMI>


The references to model elements are made using a notation that looks like XPath but I want to use the xmi:id attribute.
I can generate them inside of eclipse by checking the "Output model content types detection" setting as shown by the following excerpt:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http//schema.omg.org/spec/XMI/2.1" xmlns:uml="http//www.eclipse.org/uml2/3.0.0/UML">
  <uml:Model xmi:id="_1ddgQNWZEeGTCKqszs1QrQ" name="pattern">
    <packagedElement xmi:type="uml:Package" xmi:id="_1ddgQdWZEeGTCKqszs1QrQ" name="interfaces">
      <packagedElement xmi:type="uml:Interface" xmi:id="_1ddgQtWZEeGTCKqszs1QrQ" name="if1">
        <ownedOperation xmi:id="_1ddgQ9WZEeGTCKqszs1QrQ" name="op1"/>
      </packagedElement>
      <packagedElement xmi:type="uml:Interface" xmi:id="_1ddgRNWZEeGTCKqszs1QrQ" name="if2">
        <ownedOperation xmi:id="_1ddgRdWZEeGTCKqszs1QrQ" name="op2"/>
      </packagedElement>
      <packagedElement xmi:type="uml:Interface" xmi:id="_1ddgRtWZEeGTCKqszs1QrQ" name="if3">
        <ownedOperation xmi:id="_1ddgR9WZEeGTCKqszs1QrQ" name="op3"/>
      </packagedElement>
    </packagedElement>
  </uml:Model>
  <uml:Class xmi:id="_1deHUNWZEeGTCKqszs1QrQ" name="test" clientDependency="_1deHUdWZEeGTCKqszs1QrQ _1deHUtWZEeGTCKqszs1QrQ _1deHU9WZEeGTCKqszs1QrQ">
    <interfaceRealization xmi:id="_1deHUdWZEeGTCKqszs1QrQ" supplier="_1ddgQtWZEeGTCKqszs1QrQ" client="_1deHUNWZEeGTCKqszs1QrQ" contract="_1ddgQtWZEeGTCKqszs1QrQ"/>
    <interfaceRealization xmi:id="_1deHUtWZEeGTCKqszs1QrQ" supplier="_1ddgRNWZEeGTCKqszs1QrQ" client="_1deHUNWZEeGTCKqszs1QrQ" contract="_1ddgRNWZEeGTCKqszs1QrQ"/>
    <interfaceRealization xmi:id="_1deHU9WZEeGTCKqszs1QrQ" supplier="_1ddgRtWZEeGTCKqszs1QrQ" client="_1deHUNWZEeGTCKqszs1QrQ" contract="_1ddgRtWZEeGTCKqszs1QrQ"/>
  </uml:Class>
</xmi:XMI>


However, I cannot find how to trigger this behaviour from an external program as setting the option "OPTION_CONTENT_TYPE" to true in the options of the launcher does not help.
Is there anyone here who might have an idea on how these xmi:id are generated ?
Re: XMI IDs in external program [message #897734 is a reply to message #897571] Wed, 25 July 2012 07:49 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
Registered: July 2009
Senior Member
This isn't an ATL problem.
For serialization, ATL delegates to the corresponding resource factory.
This is done using the file extension.
Try to save the output file as a ".uml" file, this should give you what you want.
Re: XMI IDs in external program [message #897824 is a reply to message #897734] Wed, 25 July 2012 09:47 Go to previous message
Guillaume Mockly is currently offline Guillaume Mockly
Messages: 3
Registered: March 2012
Junior Member
Yes it did.
Thank you very much!
Previous Topic:EMFModelAdapter has and strange behaviour with UML models
Next Topic:ATL transformation
Goto Forum:
  


Current Time: Thu Sep 18 15:57:32 GMT 2014

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

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