Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » xmi:type instead of xsi:type(ATL M2M transformation creates xmi file with xsi:type, how to get xmi:type?)
xmi:type instead of xsi:type [message #882348] Wed, 06 June 2012 09:35 Go to next message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
I've started to learn ATL. I have done some M2M-Mappings with ATL. My target model is the UML-model delivered with eclipse. (namespace uri:http:www.eclipse.org:uml2:2.1.0:UML) The atl-script produces a xmi file as I want, but the problem is that the xmi file contains for the type a namespace which couldn't be detected by my uml model.

This is the generated xmi

<uml:Model xmi:version="2.0" xmlns:xmi="...omg.org/XMI" xmlns:xsi=".../XMLSchema-instance" xmlns:uml="..omg.org/spec/UML/20110701" name="COCT_HD080000UV09">
  <packagedElement xsi:type="uml:Package" name="R_Specimen universal">
    <packagedElement xsi:type="uml:Class" name="ActDefinition"/>


But the packagedElements should have the following attributes for importing to my uml tool.

 <packagedElement xmi:type="uml:Package" name="R_Specimen universal">
    <packagedElement xmi:type="uml:Class" name="ActDefinition"/>


I have manually changed the namespace and the import to my uml tool works.

How can I reach that the namespace of xmi is used for type instead of the xml schema namespace? Do I have to use another target Metamodel?
Re: xmi:type instead of xsi:type [message #882368 is a reply to message #882348] Wed, 06 June 2012 10:04 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Martin,

Probably it's best to ensure you save using a resource created by UML2's
specialized resource factory; failing that
XMIResource.OPTION_USE_XMI_TYPE mapped to Boolean.TRUE as a save option
should help.


On 06/06/2012 11:35 AM, Martin Benedict wrote:
> I've started to learn ATL. I have done some M2M-Mappings with ATL. My
> target model is the UML-model delivered with eclipse. (namespace
> uri:http:www.eclipse.org:uml2:2.1.0:UML) The atl-script produces a xmi
> file as I want, but the problem is that the xmi file contains for the
> type a namespace which couldn't be detected by my uml model.
>
> This is the generated xmi
>
> <uml:Model xmi:version="2.0" xmlns:xmi="...omg.org/XMI"
> xmlns:xsi=".../XMLSchema-instance"
> xmlns:uml="..omg.org/spec/UML/20110701" name="COCT_HD080000UV09">
> <packagedElement xsi:type="uml:Package" name="R_Specimen universal">
> <packagedElement xsi:type="uml:Class" name="ActDefinition"/>
>
> But the packagedElements should have the following attributes for
> importing to my uml tool.
>
> <packagedElement xmi:type="uml:Package" name="R_Specimen universal">
> <packagedElement xmi:type="uml:Class" name="ActDefinition"/>
>
>
> I have manually changed the namespace and the import to my uml tool
> works.
>
> How can I reach that the namespace of xmi is used for type instead of
> the xml schema namespace? Do I have to use another target Metamodel?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: xmi:type instead of xsi:type [message #882375 is a reply to message #882368] Wed, 06 June 2012 10:33 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

UML/20110701 is UML 2.4.1 so you must be using a Juno pre-release. This
should have xmi:version="20110701" as well as xmi:type.

Your UML configuration is therefore wrong.

Check that UMLResourcesUtil.init() is being called. It was not available
before M7, when user code had to get all the registrations right by hand.

Regards

Ed Willink


On 06/06/2012 11:04, Ed Merks wrote:
> Martin,
>
> Probably it's best to ensure you save using a resource created by
> UML2's specialized resource factory; failing that
> XMIResource.OPTION_USE_XMI_TYPE mapped to Boolean.TRUE as a save
> option should help.
>
>
> On 06/06/2012 11:35 AM, Martin Benedict wrote:
>> I've started to learn ATL. I have done some M2M-Mappings with ATL. My
>> target model is the UML-model delivered with eclipse. (namespace
>> uri:http:www.eclipse.org:uml2:2.1.0:UML) The atl-script produces a
>> xmi file as I want, but the problem is that the xmi file contains for
>> the type a namespace which couldn't be detected by my uml model.
>>
>> This is the generated xmi
>>
>> <uml:Model xmi:version="2.0" xmlns:xmi="...omg.org/XMI"
>> xmlns:xsi=".../XMLSchema-instance"
>> xmlns:uml="..omg.org/spec/UML/20110701" name="COCT_HD080000UV09">
>> <packagedElement xsi:type="uml:Package" name="R_Specimen universal">
>> <packagedElement xsi:type="uml:Class" name="ActDefinition"/>
>>
>> But the packagedElements should have the following attributes for
>> importing to my uml tool.
>>
>> <packagedElement xmi:type="uml:Package" name="R_Specimen universal">
>> <packagedElement xmi:type="uml:Class" name="ActDefinition"/>
>>
>>
>> I have manually changed the namespace and the import to my uml tool
>> works.
>>
>> How can I reach that the namespace of xmi is used for type instead of
>> the xml schema namespace? Do I have to use another target Metamodel?
>>
Re: xmi:type instead of xsi:type [message #882398 is a reply to message #882368] Wed, 06 June 2012 11:49 Go to previous messageGo to next message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
Thanks for your response.

If I want to set the XMIResource.OPTION_USE_XMI_TYPE option, do I have to create a launcher class? Or could I do this with my ant-launch script.

[Updated on: Wed, 06 June 2012 11:52]

Report message to a moderator

Re: xmi:type instead of xsi:type [message #882402 is a reply to message #882398] Wed, 06 June 2012 11:56 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Normally you'd do this in Java in your resource factory or in Java in
the options passed to the call to Resource.save.


On 06/06/2012 1:49 PM, Martin Benedict wrote:
> Thanks for your response.
>
> If I want to set the XMIResource.OPTION_USE_XMI_TYPE option. Do I have
> to create a launcher class? Or could I do this with my ant-launch script.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: xmi:type instead of xsi:type [message #882408 is a reply to message #882398] Wed, 06 June 2012 12:09 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

This is tackling the wrong problem. The correct UML installation does
this and much more automatically.

If ATL RC3 doesn't call UMLResourcesUtil.init() raise a bug quickly.

Then you may create a launcher class to call it yourself.

Regards

Ed Willink


On 06/06/2012 12:49, Martin Benedict wrote:
> Thanks for your response.
>
> If I want to set the XMIResource.OPTION_USE_XMI_TYPE option. Do I have
> to create a launcher class? Or could I do this with my ant-launch script.
Re: xmi:type instead of xsi:type [message #882417 is a reply to message #882408] Wed, 06 June 2012 12:36 Go to previous messageGo to next message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
Which parameter must I influence to get the correct UML installation? I'm sorry for asking such a stupid question, but I'm a complete beginner in ATL and EMF.

My current output now is:
<uml:Model xmi:version="2.0" xmlns:xmi="....omg.org/XMI" xmlns:xsi="....w3.org/2001/XMLSchema-instance" xmlns:uml="....eclipse.org/uml2/3.0.0/UML" name="COCT_HD080000UV09">




Edward Willink wrote on Wed, 06 June 2012 14:09
Hi

This is tackling the wrong problem. The correct UML installation does
this and much more automatically.

If ATL RC3 doesn't call UMLResourcesUtil.init() raise a bug quickly.

Then you may create a launcher class to call it yourself.

Regards

Ed Willink


On 06/06/2012 12:49, Martin Benedict wrote:
> Thanks for your response.
>
> If I want to set the XMIResource.OPTION_USE_XMI_TYPE option. Do I have
> to create a launcher class? Or could I do this with my ant-launch script.

Re: xmi:type instead of xsi:type [message #882423 is a reply to message #882417] Wed, 06 June 2012 12:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

I'm sorry, I can't help with ATL; hopefully some ATL committer/user will
respond.

I can only point out what appear to be the UML aspects of the problem.

Regards

Ed Willink

On 06/06/2012 13:36, Martin Benedict wrote:
> Which parameter must I influence to get the correct UML installation?
> I'm sorry for asking such a stupid question, but I'm a complete
> beginner in ATL and EMF.
>
> My current output now is:
> <uml:Model xmi:version="2.0" xmlns:xmi="....omg.org/XMI"
> xmlns:xsi="....w3.org/2001/XMLSchema-instance"
> xmlns:uml="....eclipse.org/uml2/3.0.0/UML" name="COCT_HD080000UV09">
>
>
>
> Edward Willink wrote on Wed, 06 June 2012 14:09
>> Hi
>>
>> This is tackling the wrong problem. The correct UML installation does
>> this and much more automatically.
>>
>> If ATL RC3 doesn't call UMLResourcesUtil.init() raise a bug quickly.
>>
>> Then you may create a launcher class to call it yourself.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 06/06/2012 12:49, Martin Benedict wrote:
>> > Thanks for your response.
>> >
>> > If I want to set the XMIResource.OPTION_USE_XMI_TYPE option. Do I
>> have > to create a launcher class? Or could I do this with my
>> ant-launch script.
>
>
Re: xmi:type instead of xsi:type [message #882431 is a reply to message #882423] Wed, 06 June 2012 13:01 Go to previous messageGo to next message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
I have written a ATL-plugin where I have defined the XMI option Ed Merks suggested. Now it sucessfully creates xmi:type attributes.

For the namespace of UML have used the eclipse namespace with 3.0.0.

According to Ed Willinks suggestions there will be more work.

The only drawback until now is, that I need a dedicated Java class for doing transformation. My aim was to have an ant script.

Thanks for any help, until now.

[Updated on: Wed, 06 June 2012 13:08]

Report message to a moderator

Re: xmi:type instead of xsi:type [message #882509 is a reply to message #882431] Wed, 06 June 2012 15:53 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Is your ouput file named xxx.uml ? ATL delegates to the resource factory using the file extension.
Re: xmi:type instead of xsi:type [message #882516 is a reply to message #882509] Wed, 06 June 2012 15:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
On 06/06/2012 16:53, Sylvain EVEILLARD wrote:
> Is your ouput file named xxx.uml ? ATL delegates to the resource
> factory using the file extension.
This is probably alright for output, but is not consistent with the user
reports:

1st: ....omg.org/spec/UML/20110701 implies a Jiuno pre-release
2nd: ....eclipse.org/uml2/3.0.0/UML implies Indigo

if default creation is occurring.

Regards

Ed Willink
Re: xmi:type instead of xsi:type [message #882566 is a reply to message #882516] Wed, 06 June 2012 18:37 Go to previous message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
The file is currently name xmi. I will have a try with *.uml

I see, in my first report there was the first mentioned value was occuring. I don't know and I can't reproduce. Perhaps it was reasoned by some experiments with other tools.
The second value ...eclipse.org/uml2/3.0.0/UML is the right one. It occurs always if I generate my model.

EDIT:

I have tested with file extension .uml. Now it works also with my ant script. Great!
Thank You

[Updated on: Wed, 06 June 2012 19:03]

Report message to a moderator

Previous Topic:How to improve my ATL transformation
Next Topic:Why isn't my profile applied?
Goto Forum:
  


Current Time: Tue Apr 23 08:11:22 GMT 2024

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

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

Back to the top