Skip to main content



      Home
Home » Modeling » QVT-Relations » PropertyTemplates with OCL
PropertyTemplates with OCL [message #1081671] Wed, 07 August 2013 10:31 Go to next message
Eclipse UserFriend
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 10:36] by Moderator

Re: PropertyTemplates with OCL [message #1081823 is a reply to message #1081671] Wed, 07 August 2013 14:42 Go to previous messageGo to next message
Eclipse UserFriend
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 17:15 Go to previous messageGo to next message
Eclipse UserFriend

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 09:02 Go to previous message
Eclipse UserFriend
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:"opposite" tag in property templates
Goto Forum:
  


Current Time: Wed Mar 26 23:19:29 EDT 2025

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

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

Back to the top