Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Including UML primitive types in result of transformation
Including UML primitive types in result of transformation [message #1495877] Tue, 02 December 2014 15:42 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 169
Registered: June 2010
Senior Member
Hi,

Assume that I want to transform from some language to uml. Assume that I would like to create UML classes with attributes that have UML primitive types. How do I refer to primitive types that are also used when creating UML models using the imported the UML primitive types.

For instance one of my mappings look like:

mapping Field::fieldToAttribute(): uml::Property
{
	result.name := self.field;
	result.type := getBoolType();
}


How to I get a reference to the same UML Primitive Types that are present when I create a UML model using Papyrus based on a 'model with primitive types' template?

When I create such model I see that in contains a packageImport that refers to: pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0

Do I need to add an additional parameter to my transformation representing the library? Then I could query that model element. But then, how to I refer to the UMLPrimitiveTypes library (as that one is not present in my workspace and I can only refer to models that are present in my workspace using the standard QVT launcher).

I can also imagine that I need to create the package import also in my resulting model (during one of the earliest stages in my transformation). But then again, how do I refer to the UMLPrimitiveTypes library?

Greetings,
Wilbert.

Re: Including UML primitive types in result of transformation [message #1496019 is a reply to message #1495877] Tue, 02 December 2014 18:11 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5393
Registered: July 2009
Senior Member
Hi

PrimitiveTypes are Primitive, which is fine until you have multiple
languages. UML/OCL/Ecore/...

I take the view that PrimitiveTypes have a name but no namespace, so
A::Boolean is the same type as B::Boolean and just Boolean.

This potentially resolves the diversity of inputs.

When generating output you must select a PrimitiveType
that your downstream consumers will be happy with.

For an understanding serializer true.oclType() will give you OCL Boolean
which might get converted to the correct Boolean.

However QVTo is not helpful for UML, so you will indeed need to access
the correct model element, either by loading the model and querying it
using OCL or by providing a black box access with Java queries.

Regards

Ed Willink


On 02/12/2014 15:42, Wilbert Alberts wrote:
> Hi,
>
> Assume that I want to transform from some language to uml. Assume that I
> would like to create UML classes with attributes that have UML primitive
> types. How do I refer to primitive types that are also used when
> creating UML models using the imported the UML primitive types.
>
> For instance one of my mappings look like:
>
>
> mapping Field::fieldToAttribute(): uml::Property
> {
> result.name := self.field;
> result.type := getBoolType();
> }
>
> How to I get a reference to the same UML Primitive Types that are
> present when I create a UML model using Papyrus based on a 'model with
> primitive types' template?
>
> When I create such model I see that in contains a packageImport that
> refers to: pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0
>
> Do I need to add an additional parameter to my transformation
> representing the library? Then I could query that model element. But
> then, how to I refer to the UMLPrimitiveTypes library (as that one is
> not present in my workspace and I can only refer to models that are
> present in my workspace using the standard QVT launcher).
>
> I can also imagine that I need to create the package import also in my
> resulting model (during one of the earliest stages in my
> transformation). But then again, how do I refer to the UMLPrimitiveTypes
> library?
>
> Greetings,
> Wilbert.
>
>
Previous Topic:Storing and loading .qvtox
Next Topic:handling of abstract types
Goto Forum:
  


Current Time: Wed Sep 20 13:07:37 GMT 2017

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

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