Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Passing parameters(Psssing parameters programtically to an eto job.)
Passing parameters [message #1719282] Wed, 06 January 2016 18:58 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 8
Registered: January 2016
Junior Member
I want to run epsilon scripts server side, which means passing parameters to them. I read about how to do this with ant tasks, but would rather get it done from java.

I tried using the ConsoleUserInput class, but it seems its chooseMany method is not implemented. My first up use case is to do a transformation driven by a collection of values.

Am I barking up the wrong tree here?

Thanks
Re: Passing parameters [message #1719284 is a reply to message #1719282] Wed, 06 January 2016 19:07 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Geoffry,

Do you need the user to provide values for these parameters at runtime? If values are known in advance, you could use Epsilon's API to pass parameters to programs as follows:

EolModule module = ...;
module.parse(...);
Variable parameter = ...;
module.getContext().getFrameStack().put(parameter);


Cheers,
Dimitris
Re: Passing parameters [message #1719288 is a reply to message #1719284] Wed, 06 January 2016 19:21 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 8
Registered: January 2016
Junior Member
Thanks for the quick response.

Yes, I want to pass parameters at runtime. I envision this all happening in a web app. EMF/Epsilon would reside behind a REST call with parameters coming in from user actions on a web page.
Re: Passing parameters [message #1719289 is a reply to message #1719288] Wed, 06 January 2016 19:22 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Geoffry,

The suggested solution should work well for this use case.

Cheers,
Dimitris

[Updated on: Wed, 06 January 2016 19:22]

Report message to a moderator

Re: Passing parameters [message #1719291 is a reply to message #1719289] Wed, 06 January 2016 19:50 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 8
Registered: January 2016
Junior Member
Here's what I have. Am I on target? I haven't finished my etl script yet.

// Load emf model from xmi file
InMemoryEmfModel model = loadData("profiles/profile-2.7.xmi");
// load etl script from etl file
IEolExecutableModule module = loadModule("first.etl");
// Create parameters
Set<String> set = new HashSet<String>();
set.add("aaa");
set.add("bbb");
set.add("ccc");
Variable params = new Variable("messageIds", set, EolCollectionType.Set);
module.getContext().getFrameStack().put(params);
module.getContext().getModelRepository().addModel(model);

// Run it all.
module.execute();
Re: Passing parameters [message #1719292 is a reply to message #1719291] Wed, 06 January 2016 19:52 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

This all looks fine to me.

Cheers,
Dimitris
Previous Topic:EWL: How to run a sample wizard in UML Designer & Eclipse Mars
Next Topic:Logging feature in ETL, EGL scripts
Goto Forum:
  


Current Time: Tue Apr 23 08:51:23 GMT 2024

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

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

Back to the top