Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-Relations » PropertyTemplates with OCL
PropertyTemplates with OCL [message #1081671] Wed, 07 August 2013 14:31 Go to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 126
Registered: September 2011
Senior Member
Is it possible to directly access properties with OCL navigation?

Consider the following relation:

top relation AtoA {

		enforce domain source aLeft: simplesource::A{
			b=z:simplesource::B{},
			str = aRight.b.str
		};
		
		enforce domain target aRight: simpletarget::A{
			b=z2:simpletarget::B{
				
			}
			
		};	

	}


I want to produce a consistent output model instance from a input model instance. That means, the output model instance is empty before the transformation.

When the transformation is executed in target direction (empty target model instance), I expect that aLeft.str will not be matched in the source graph since aRight is not bound yet.

Now, when the transformation is executed in source direction (empty source model instance), I expect that the value of aRight.b.str is assigned to aLeft.str.

Is this correct? Can I use arbitary OCL queries to access attributes of a domain element?

[Updated on: Wed, 07 August 2013 14:36]

Report message to a moderator

Re: PropertyTemplates with OCL [message #1081823 is a reply to message #1081671] Wed, 07 August 2013 18:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4188
Registered: July 2009
Senior Member
Hi

Yes you can use arbitrary OCL on the RHS, but of course your
transformation is unlikely to be bidirectional.

REgards

Ed Willink


On 07/08/2013 15:31, Goood Guy wrote:
> Is it possible to directly access properties with OCL navigation?
>
> Consider the following relation:
>
>
> top relation AtoA {
>
> enforce domain source aLeft: simplesource::A{
> b=z:simplesource::B{},
> str = aRight.b.str
> };
>
> enforce domain target aRight: simpletarget::A{
> b=z2:simpletarget::B{
>
> }
>
> };
>
> }
>
>
> When the transformation is executed in target direction, I expect that
> aLeft.str will not be matched in the source graph since aRight is not
> bound yet.
> Now, when the transformation is executed in source direction, I expect
> that the value of aRight.b.str is assigned to aLeft.str.
>
> Is this correct? Can I use arbitary OCL queries to access attributes
> of a domain element?
Re: PropertyTemplates with OCL [message #1081902 is a reply to message #1081823] Wed, 07 August 2013 21:15 Go to previous messageGo to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 126
Registered: September 2011
Senior Member

Hi,

thank you very much. Do you mean my transformation is unlikely to be bidirectional because the str-attribute is assigned only in the target-to-source direction but not in the source-to-target direction?
Re: PropertyTemplates with OCL [message #1082356 is a reply to message #1081902] Thu, 08 August 2013 13:02 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4188
Registered: July 2009
Senior Member
Hi

No. Because a complex RHS in a forward direction becomes a complex
pattern match in the reverse direction and if where this is possible,
tooling is liable to be simplistic.

Regards

Ed Willink


On 07/08/2013 22:15, Goood Guy wrote:
>
> Hi,
>
> thank you very much. Do you mean my transformation is unlikely to be
> bidirectional because the str-attribute is assigned only in the
> target-to-source direction but not in the source-to-target direction?
Previous Topic:Primitive Domains in Top Relations
Next Topic:Generate qvtr file programmatically
Goto Forum:
  


Current Time: Sun Dec 21 18:08:32 GMT 2014

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

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