Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Stereotypes and root element
Stereotypes and root element [message #965693] Wed, 31 October 2012 08:42 Go to next message
Carsten Reckord is currently offline Carsten Reckord
Messages: 17
Registered: June 2012
Junior Member
Hi there,

I'm having some trouble with an in-place transformation of a UML model.
During the transformation, some new nested elements are created in the model
and a stereotype is applied to them. This works great during the
transformation.

But when running the transformation with the Operational QVT Runner, the
updated UML file does not contain the stereotype applications. After some
debugging, I found the problem:

QvtLaunchConfigurationDelegateBase.saveTransformationResult(...) essentially
restricts the contents of the saved resource to the input model extent,
which consists only of the Model element. The stereotype application
instances, which are directly contained in the resource as siblings of the
model, are removed from the resource by that logic.

So, is there a way to add these elements to the model extent so they are
retained in the result? Should there be some metamodel specific filtering
going on that knows about UML's stereotype handling?


Best regards,
Carsten
Re: Stereotypes and root element [message #965715 is a reply to message #965693] Wed, 31 October 2012 09:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3849
Registered: July 2009
Senior Member
Hi

In the absence of a more helpful reply...

Interesting, I wasn't sure whether in-place transformations were supported.

I'm afraid that you are now an expert, so your discoveries are probably
correct. Could you please submit a Bugzilla with your observations and
possibly a patch if you keen on it.

It is unfortunate that projects such as ATL, QVTo, Acceleo, OCL all have
to provide their own (partial and inconsistent) attempts at stereotype
support. The new pivot-based Eclipse OCL endeavours to provide a
coherent merged UML and OCL meta-model in which stereotypes are
supported. Once QVTo migrates to this support there should be more
uniformity and consistency. GIven the limited committer resources, my
best guess is that this might be in the 2014 release.

Regards

Ed Willink

On 31/10/2012 12:42, Carsten Reckord wrote:
> Hi there,
>
> I'm having some trouble with an in-place transformation of a UML
> model. During the transformation, some new nested elements are created
> in the model and a stereotype is applied to them. This works great
> during the transformation.
>
> But when running the transformation with the Operational QVT Runner,
> the updated UML file does not contain the stereotype applications.
> After some debugging, I found the problem:
>
> QvtLaunchConfigurationDelegateBase.saveTransformationResult(...)
> essentially restricts the contents of the saved resource to the input
> model extent, which consists only of the Model element. The stereotype
> application instances, which are directly contained in the resource as
> siblings of the model, are removed from the resource by that logic.
>
> So, is there a way to add these elements to the model extent so they
> are retained in the result? Should there be some metamodel specific
> filtering going on that knows about UML's stereotype handling?
>
>
> Best regards,
> Carsten
Re: Stereotypes and root element [message #985272 is a reply to message #965715] Thu, 15 November 2012 04:16 Go to previous messageGo to next message
Daniel Scholz is currently offline Daniel Scholz
Messages: 1
Registered: November 2012
Junior Member
Hi Carsten,

how did you manage to apply the stereotype? I'm having some trouble applying stereotypes on newly created elements during an in-place transformation. My input model has the (Modal Sequence Diagram) profile applied and I can get the stereotype and its values from messages that I created in the editor beforehand. But I cannot create a new standard element (let's say a UML message) and apply the same stereotype. isStereotypeApplicable() -> false..

Thanks in advance for any hint,
Daniel
Re: Stereotypes and root element [message #987411 is a reply to message #985272] Mon, 26 November 2012 09:02 Go to previous messageGo to next message
Carsten Reckord is currently offline Carsten Reckord
Messages: 17
Registered: June 2012
Junior Member
Hi Daniel,

On 15.11.2012 15:03, Daniel Scholz wrote:
> how did you manage to apply the stereotype? I'm having some trouble applying stereotypes on newly created elements during an in-place transformation. My input model has the (Modal Sequence Diagram) profile applied and I can get the stereotype and its values from messages that I created in the editor beforehand. But I cannot create a new standard element (let's say a UML message) and apply the same stereotype. isStereotypeApplicable() -> false..

Strange, that just worked for me. I couldn't figure out how to apply a
profile, so I'm currently requiring the model to already have the profile
applied. But other than that, it just worked. I'm currently doing it like this:

mapping Package::usage (used : Package) : Usage {
init {
result := self.createUsage(used);
let s : Stereotype =
result.getApplicableStereotype("Dependencies::UsageCount") in
result.applyStereotype(result.stereotype);
}
name := self.name+"_uses_"+used.name;
let s : Stereotype =
result.getAppliedStereotype("Dependencies::UsageCount") in
result.setValue(s, "count", 0);
}

Can you post the relevant snippets of how you are trying to apply your
Stereotype?
Re: Stereotypes and root element [message #987413 is a reply to message #987411] Mon, 26 November 2012 09:13 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3849
Registered: July 2009
Senior Member
Hi

Additional features for the QVTo language should be raised as OMG issues
at OMG.

Additional features for the QVTo tooling should be raised as Bugzillas,
but do not expect much response until we have migrated to underlying
Xtext-based tooling. We are very short of resources, so if you want to
help ...

Regards

Ed Willink


On 26/11/2012 14:02, Carsten Reckord wrote:
> Hi Daniel,
>
> On 15.11.2012 15:03, Daniel Scholz wrote:
>> how did you manage to apply the stereotype? I'm having some trouble applying stereotypes on newly created elements during an in-place transformation. My input model has the (Modal Sequence Diagram) profile applied and I can get the stereotype and its values from messages that I created in the editor beforehand. But I cannot create a new standard element (let's say a UML message) and apply the same stereotype. isStereotypeApplicable() -> false..
> Strange, that just worked for me. I couldn't figure out how to apply a
> profile, so I'm currently requiring the model to already have the profile
> applied. But other than that, it just worked. I'm currently doing it like this:
>
> mapping Package::usage (used : Package) : Usage {
> init {
> result := self.createUsage(used);
> let s : Stereotype =
> result.getApplicableStereotype("Dependencies::UsageCount") in
> result.applyStereotype(result.stereotype);
> }
> name := self.name+"_uses_"+used.name;
> let s : Stereotype =
> result.getAppliedStereotype("Dependencies::UsageCount") in
> result.setValue(s, "count", 0);
> }
>
> Can you post the relevant snippets of how you are trying to apply your
> Stereotype?
Re: Stereotypes and root element [message #987416 is a reply to message #987413] Mon, 26 November 2012 09:17 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 3849
Registered: July 2009
Senior Member
Hi

Apologies. Reply to wrong thread.

Regards

Ed Willink


On 26/11/2012 14:13, Ed Willink wrote:
> Hi
>
> Additional features for the QVTo language should be raised as OMG
> issues at OMG.
>
> Additional features for the QVTo tooling should be raised as
> Bugzillas, but do not expect much response until we have migrated to
> underlying Xtext-based tooling. We are very short of resources, so if
> you want to help ...
>
> Regards
>
> Ed Willink
>
>
> On 26/11/2012 14:02, Carsten Reckord wrote:
>> Hi Daniel,
>>
>> On 15.11.2012 15:03, Daniel Scholz wrote:
>>> how did you manage to apply the stereotype? I'm having some trouble
>>> applying stereotypes on newly created elements during an in-place
>>> transformation. My input model has the (Modal Sequence Diagram)
>>> profile applied and I can get the stereotype and its values from
>>> messages that I created in the editor beforehand. But I cannot
>>> create a new standard element (let's say a UML message) and apply
>>> the same stereotype. isStereotypeApplicable() -> false..
>> Strange, that just worked for me. I couldn't figure out how to apply a
>> profile, so I'm currently requiring the model to already have the
>> profile
>> applied. But other than that, it just worked. I'm currently doing it
>> like this:
>>
>> mapping Package::usage (used : Package) : Usage {
>> init {
>> result := self.createUsage(used);
>> let s : Stereotype =
>> result.getApplicableStereotype("Dependencies::UsageCount") in
>> result.applyStereotype(result.stereotype);
>> }
>> name := self.name+"_uses_"+used.name;
>> let s : Stereotype =
>> result.getAppliedStereotype("Dependencies::UsageCount") in
>> result.setValue(s, "count", 0);
>> }
>>
>> Can you post the relevant snippets of how you are trying to apply your
>> Stereotype?
>
Previous Topic:[QVTo] Scope of Resolve Expressions
Next Topic:Collections and typecasting...
Goto Forum:
  


Current Time: Thu Apr 24 15:00:43 EDT 2014

Powered by FUDForum. Page generated in 0.05876 seconds