Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » [QVTo] Transform an object by a condition.
[QVTo] Transform an object by a condition. [message #1718355] Tue, 22 December 2015 20:01 Go to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi,

Can I reference an object in a mapping from another mapping?

I need transform an object consulting an object in another mapping.

Thanks.
Re: [QVTo] Transform an object by a condition. [message #1718372 is a reply to message #1718355] Wed, 23 December 2015 06:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5887
Registered: July 2009
Senior Member
Hi

The easiest way is to share the object is via a parameter. However if
it's a generated object you need to use 'resolve'.

The specification/description of 'resolve' is much improved in QVT 1.3
(approved but not yet released). See 8.1.11 of
http://www.omg.org/cgi-bin/doc?ptc/15-10-02

Beware, most of the changes in QVT 1.3 are clarification of vagueness
that Eclipse QVTo already implements, however some clarifications are
not yet implemented by Eclipse QVTo, so don't push into dark corners.

Regards

Ed Willink


On 22/12/2015 20:01, Gonzalo Bressan Zuber wrote:
> Hi,
>
> Can I reference an object in a mapping from another mapping?
>
> I need transform an object consulting an object in another mapping.
>
> Thanks.
Re: [QVTo] Transform an object by a condition. [message #1718429 is a reply to message #1718372] Wed, 23 December 2015 15:07 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi Ed,

The object belongs to a source model.

How use the arguments?

Thanks.
Re: [QVTo] Transform an object by a condition. [message #1718443 is a reply to message #1718429] Wed, 23 December 2015 17:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5887
Registered: July 2009
Senior Member
How understand question? https://wiki.eclipse.org/OCL/ForumNetiquette


On 23/12/2015 15:07, Gonzalo Bressan Zuber wrote:
> Hi Ed,
>
> The object belongs to a source model.
>
> How use the arguments?
>
> Thanks.
>
Re: [QVTo] Transform an object by a condition. [message #1718451 is a reply to message #1718443] Wed, 23 December 2015 22:25 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Sorry if I did not express well.

I'll try again:

In this case, i'm working in a following mapping of the transformation

mapping java::InfixExpression::ie2ie() : java::InfixExpression {
operator := self.operator;
comments := self.comments -> com2com();
originalCompilationUnit := self.originalCompilationUnit.map cu2cu();
originalClassFile := self.originalClassFile.map cf2cf();
rightOperand := self.rightOperand.map ex2ex();
leftOperand := self.leftOperand.map ex2ex();
extendedOperands := self.extendedOperands -> ex2ex();
}

I need to transform the object "operator" belonging to ie2ie mapping if exists a comment equal to "//mutate" in the java program in the same line that an infix expression.

You understande me now?

Thanks.
Re: [QVTo] Transform an object by a condition. [message #1719493 is a reply to message #1718451] Fri, 08 January 2016 10:52 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5887
Registered: July 2009
Senior Member
Hi

I'll try again too: https://wiki.eclipse.org/OCL/ForumNetiquette


On 23/12/2015 22:25, Gonzalo Bressan Zuber wrote:
> Sorry if I did not express well.
>
> I'll try again:
>
> In this case, i'm working in a following mapping of the transformation
>
> mapping java::InfixExpression::ie2ie() : java::InfixExpression {
> operator := self.operator;
> comments := self.comments -> com2com();
> originalCompilationUnit := self.originalCompilationUnit.map cu2cu();
> originalClassFile := self.originalClassFile.map cf2cf();
> rightOperand := self.rightOperand.map ex2ex();
> leftOperand := self.leftOperand.map ex2ex();
> extendedOperands := self.extendedOperands -> ex2ex();
> }
>
> I need to transform the object "operator" belonging to ie2ie mapping
> if exists a comment equal to "//mutate" in the java program in the
> same line that an infix expression.
>
> You understande me now?
>
> Thanks.
Previous Topic:QVTo Trace Editor doesn't show properties of elements
Next Topic:Keeping xmi:id for migration
Goto Forum:
  


Current Time: Fri May 25 09:28:01 GMT 2018

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

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

Back to the top