Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Arguments with called rules
Arguments with called rules [message #724266] Sun, 11 September 2011 16:38 Go to next message
fafanellu  is currently offline fafanellu
Messages: 37
Registered: July 2011
Member
Hi,
I'd like to know what sort of parameters I can use when calling a called rule from another rule (only the basic types, or also the types from my source metamodel?).

I have a called rule of this form :

rule createREF (s : A!A1) {
	to
		d:B!B2(
 	              attribute <- s.something
			)
}


which takes as a parameter an instance of A1 type, and a classic matched rule of this form :

rule createDeltaIntRule{
	from
		s:A!A1
	to
		d:B!B1(
			a1<-thisModule.createREF(s)
			)
}


As I said before, I'd like to call createREF, giving to it s (A!A1) as a parameter. Is it possible to do so ?

Thanks for your help
Re: Arguments with called rules [message #724361 is a reply to message #724266] Mon, 12 September 2011 03:32 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
Registered: July 2009
Senior Member
This is possible but in a called rule you have to specify in the "do" code the variable the rule returns.
Here you'd do :
do{
d;
}
Re: Arguments with called rules [message #724366 is a reply to message #724361] Mon, 12 September 2011 04:01 Go to previous message
fafanellu  is currently offline fafanellu
Messages: 37
Registered: July 2011
Member
yes, thanks !
That's why I got an error !
Previous Topic:[QVTo] factoryEntries in class EclipseRegistry/ interface UnitResolverFactory are empty
Next Topic:How to handle references?
Goto Forum:
  


Current Time: Mon Jul 28 02:33:39 EDT 2014

Powered by FUDForum. Page generated in 0.02039 seconds