Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-Relations » Primitive Domains in Top Relations
Primitive Domains in Top Relations [message #1081503] Wed, 07 August 2013 09:54 Go to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
Hi,

I wonder what should happen if a top relation has a primitive domain. As far as I understand, if the relation is not called in a when clause, the primitive domain cannot be bound.

For example I have the following relation:

transformation source2target(source:simplesource, target:simpletarget){
	
	top relation AtoA {

		varSourceB:simplesource::B;
		varTargetB:simpletarget::B;
		varStr:String;
		enforce domain source aLeft: simplesource::A{
			b=varSourceB, 
			str=varStr
		};
		

		
		enforce domain target aRight: simpletarget::A{
			b=varTargetB
			

		};
		
		when{
		
			BtoB(varSourceB,varTargetB, varStr);
		}

	}
	
	top relation BtoB{
	
		varStr:String;
		enforce domain source bLeft: simplesource::B{
		};
		

		
		enforce domain target bRight: simpletarget::B{

			str=varStr
		};
		
		primitive domain pd:String;
		
		when{
			varStr = pd;
		}
	}
}
Re: Primitive Domains in Top Relations [message #1081587 is a reply to message #1081503] Wed, 07 August 2013 12:24 Go to previous messageGo to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
I think I found an alternative solution that does not require primitive domains:

	top relation AtoA {

		varStr:String;
		enforce domain source aLeft: simplesource::A{
			b=z:simplesource::B{},
			str = varStr
		};
		
		enforce domain target aRight: simpletarget::A{
			b=z2:simpletarget::B{
				str = varStr
			}
			
		};
		
		when{
			varStr = aLeft.str or varStr = aRight.b.str;
			BtoB(z, z2);
		}
		

	}

Re: Primitive Domains in Top Relations [message #1081824 is a reply to message #1081503] Wed, 07 August 2013 18:44 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

QVTr is multi-directional.

One or more domains are input, one is output, others may be used/ignored
as appropriate.

Regards

Ed Willink


On 07/08/2013 10:54, Goood Guy wrote:
> Hi,
>
> I wonder what should happen if a top relation has a primitive domain.
> As far as I understand, if the relation is not called in a when
> clause, the primitive domain cannot be bound.
>
> For example I have the following relation:
>
>
> transformation source2target(source:simplesource, target:simpletarget){
>
> top relation AtoA {
>
> varSourceB:simplesource::B;
> varTargetB:simpletarget::B;
> varStr:String;
> enforce domain source aLeft: simplesource::A{
> b=varSourceB, str=varStr
> };
>
>
>
> enforce domain target aRight: simpletarget::A{
> b=varTargetB
>
>
> };
>
> when{
>
> BtoB(varSourceB,varTargetB, varStr);
> }
>
> }
>
> top relation BtoB{
>
> varStr:String;
> enforce domain source bLeft: simplesource::B{
> };
>
>
>
> enforce domain target bRight: simpletarget::B{
>
> str=varStr
> };
>
> primitive domain pd:String;
>
> when{
> varStr = pd;
> }
> }
> }
>
Previous Topic:Current status of QVTd?
Next Topic:PropertyTemplates with OCL
Goto Forum:
  


Current Time: Fri Mar 29 00:09:45 GMT 2024

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

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

Back to the top