Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Shortcut for subpackages?
Shortcut for subpackages? [message #1064905] Fri, 21 June 2013 15:10 Go to next message
Daniele Pala is currently offline Daniele Pala
Messages: 6
Registered: September 2011
Junior Member
Hello, I have a very basic question: is it possible, in a QVTO script, to define 'shortcut' names for subpackages? I'm writing a transformation but I end up with very long names, like

CIM::IEC61968::AssetInfo::PowerTransformerInfo
CIM::IEC61970::Topology::TopologicalNode

This produces some very bad-looking code.

Thanks a lot!

Daniele Pala
Re: Shortcut for subpackages? [message #1066722 is a reply to message #1064905] Thu, 04 July 2013 05:45 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4095
Registered: July 2009
Senior Member
Hi

Suddenly had an idea. The basic ModelType syntax is

modeltype UML uses SimpleUml ("http://omg.qvt-examples.SimpleUml");

Have you tried using a fragment URI such as

modeltype AssetInfo uses AssetInfo ("...CIM#/IEC61968/AssetInfo");

EMF should share the multiple loads of ...CIM
so QVTo should recognize that
CIM::IEC61968::AssetInfo::PowerTransformerInfo and
AssetInfo::PowerTransformerInfo are the same type. But it might be safer
to use a different spelling for the alias.

(You can find the correct spelling of the fragment in any serialized XMI
reference to the target).

Regards

Ed Willink


On 21/06/2013 16:10, Daniele Pala wrote:
> Hello, I have a very basic question: is it possible, in a QVTO script,
> to define 'shortcut' names for subpackages? I'm writing a
> transformation but I end up with very long names, like
> CIM::IEC61968::AssetInfo::PowerTransformerInfo
> CIM::IEC61970::Topology::TopologicalNode
>
> This produces some very bad-looking code.
>
> Thanks a lot!
>
> Daniele Pala
>
Re: Shortcut for subpackages? [message #1067422 is a reply to message #1064905] Mon, 08 July 2013 14:57 Go to previous messageGo to next message
Daniele Pala is currently offline Daniele Pala
Messages: 6
Registered: September 2011
Junior Member
Hi, thanks for your reply!
It works, with this syntax:

modeltype AssetInfo uses "http: //iec.ch/TC57/2010/CIM-schema-cim15#AssetInfo";

I then have to define a new metamodel mapping in the project settings:

Source model URI:
http: //iec.ch/TC57/2010/CIM-schema-cim15#AssetInfo

Target model URI:
platform:/resource/atlantide2cim.bundle/models/cim15.ecore#//IEC61968/AssetInfo

I don't know if there is another syntax avoiding the metamodel mapping stuff...

Thanks again,
Daniele Pala
Re: Shortcut for subpackages? [message #1067425 is a reply to message #1067422] Mon, 08 July 2013 15:19 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4095
Registered: July 2009
Senior Member
Hi

It looks as if fragment URIs are not well supported by the modelType
syntax. Please raise a Bugzilla.

Since your http: //iec.ch/TC57/2010/CIM-schema-cim15#AssetInfo is a
fudge rather actually a fragment identifier, I recommend using some
other character such as ~ to avoid confusing some unfortunate maintainer
later.

Regards

Ed Willink


On 08/07/2013 15:57, Daniele Pala wrote:
> Hi, thanks for your reply! It works, with this syntax:
>
> modeltype AssetInfo uses "http:
> //iec.ch/TC57/2010/CIM-schema-cim15#AssetInfo";
>
> I then have to define a new metamodel mapping in the project settings:
>
> Source model URI:
> http: //iec.ch/TC57/2010/CIM-schema-cim15#AssetInfo
>
> Target model URI:
> platform:/resource/atlantide2cim.bundle/models/cim15.ecore#//IEC61968/AssetInfo
>
> I don't know if there is another syntax avoiding the metamodel mapping
> stuff...
>
> Thanks again,
> Daniele Pala
Previous Topic:Applying Stereotype to model element
Next Topic:Object type issues
Goto Forum:
  


Current Time: Thu Oct 23 19:23:32 GMT 2014

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

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