|Re: Including UML primitive types in result of transformation [message #1496019 is a reply to message #1495877]
||Tue, 02 December 2014 18:11
| Ed Willink
Registered: July 2009
PrimitiveTypes are Primitive, which is fine until you have multiple
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.
On 02/12/2014 15:42, Wilbert Alberts wrote:
> 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
Powered by FUDForum
. Page generated in 0.01831 seconds