Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] random function available?
[ATL] random function available? [message #69868] Tue, 18 December 2007 17:31 Go to next message
Eclipse UserFriend
Originally posted by: r.c.ladan.tue.nl

Hi,

I wonder if there is a random() function available in ATL since I need this in a program for work.
An alternative would be to post-process the output in Java (e.g. substituting strings 'RANDOM' with a random value).

Thanks,
Rene
Re: [ATL] random function available? [message #715185 is a reply to message #69868] Fri, 12 August 2011 16:00 Go to previous messageGo to next message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
I also need it... some news? i need to invoke a rule using random function...I mean that in the input filter i would like to have a random calculation that decides if execute or not the rule...
Re: [ATL] random function available? [message #716014 is a reply to message #715185] Tue, 16 August 2011 08:21 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You can modify the ATL VM engine to add a random function or you can add an EOperation in your meta-model that you will call in the ATL code.
Re: [ATL] random function available? [message #716399 is a reply to message #716014] Wed, 17 August 2011 09:59 Go to previous messageGo to next message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
can you provide more info on the second option? thx again
Re: [ATL] random function available? [message #716456 is a reply to message #716399] Wed, 17 August 2011 13:05 Go to previous messageGo to next message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
I don't know how to use EOperation... can I define a EOperation that calls a java method like random in MAth class??
Re: [ATL] random function available? [message #716460 is a reply to message #716456] Wed, 17 August 2011 13:22 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Yes of course. EOperation are EMF things. Watch for the corresponding documentation.
Re: [ATL] random function available? [message #716765 is a reply to message #69868] Thu, 18 August 2011 11:38 Go to previous messageGo to next message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
ok...I defined an EOperation on my mm.... but now...I'm working on ecore in input metamodel and I guess I have to call s.refInvokeOperation(p.name, Sequence{}); ...
if i print s.eoperations i receive the right operation name...but if i try to call it i receive an error:
org.eclipse.m2m.atl.engine.emfvm.VMException: Operation getRandom not found on EClass

do you know why??
Re: [ATL] random function available? [message #717602 is a reply to message #69868] Sun, 21 August 2011 16:34 Go to previous message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
i defied correctly (i think) the eoperation...generated model code... defined the body of the Impl of the eoperation with my function...but:

Operation getRandom not found on C
Previous Topic:execute rule only for one object
Next Topic:[ATL] Getting ATL output file to correspond to correct Meta-Model
Goto Forum:
  


Current Time: Fri Mar 29 00:47:41 GMT 2024

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

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

Back to the top