Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EOL/ETL/ECL] How to exchange variables(Exchange variable values between java plug-in and modules)
[EOL/ETL/ECL] How to exchange variables [message #1354310] Wed, 14 May 2014 07:45 Go to next message
Alexander Fülleborn is currently offline Alexander FüllebornFriend
Messages: 132
Registered: April 2013
Senior Member
Good morning Dimitris,

I would like to do the following: In my Eclipse java plug-in, I set a variable value. Then I call an ECL module, where I change the value of this variable. Finally, I read the changed variable within my plug-in again.

I looked for any examples, but I found only an example where the EOL module creates a plug-in instance and changes variables within this instance ("Example: Creating custom Java tools for Epsilon"). Hence, this is more the "vice versa way".

Would be glad to get hints how to realize my scenario.

Thanks a lot and kind regards, Alex


Re: [EOL/ETL/ECL] How to exchange variables [message #1354319 is a reply to message #1354310] Wed, 14 May 2014 07:50 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 Alex,

<ecl-module>.getContext().getFrameStack().get(<variable-name>) should do the trick.

Cheers,
Dimitris
Re: [EOL/ETL/ECL] How to exchange variables [message #1354368 is a reply to message #1354319] Wed, 14 May 2014 08:18 Go to previous messageGo to next message
Alexander Fülleborn is currently offline Alexander FüllebornFriend
Messages: 132
Registered: April 2013
Senior Member
Hi again,

I found the problem and it works fine now!

Thanks a lot, Dimitris!

KR, Alex

~~~
Hi Dimitris,

thanks a lot. Sounds promising... Wink. However, I have problems with providing the actual parameter value for "Variable".

Example:
String value;
String variable_name = "g_variabletest";
value = module.getContext().getFrameStack().get(variable_name);

I get an error message related to type conversion. I also tried to use the type "Variable", but it does not work neither.

Cheers, Alex

[Updated on: Wed, 14 May 2014 08:50]

Report message to a moderator

Re: [EOL/ETL/ECL] How to exchange variables [message #1355533 is a reply to message #1354368] Wed, 14 May 2014 19:31 Go to previous messageGo to next message
Alexander Fülleborn is currently offline Alexander FüllebornFriend
Messages: 132
Registered: April 2013
Senior Member
Hi Dimitris,

I went a step further and wanted to calculate with the variable values in my plug-in. However, I have problems to cast it to Integer values. Do you have an idea how to ideally calculate with the variables in a java environment?

Thanks a lot and kind regards, Alex
Re: [EOL/ETL/ECL] How to exchange variables [message #1356938 is a reply to message #1355533] Thu, 15 May 2014 09:38 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 Alex,

What do you get when you run the following?

System.out.println(module.getContext().getFrameStack().get(variable_name).getClass().getSimpleName());

Cheers,
Dimitris
Re: [EOL/ETL/ECL] How to exchange variables [message #1372435 is a reply to message #1356938] Wed, 21 May 2014 20:54 Go to previous messageGo to next message
Alexander Fülleborn is currently offline Alexander FüllebornFriend
Messages: 132
Registered: April 2013
Senior Member
Hi Dimitris,

the output is "Variable". Does this help?

Cheers, Alex
Re: [EOL/ETL/ECL] How to exchange variables [message #1372463 is a reply to message #1372435] Wed, 21 May 2014 21: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 Alex,

Does the following return what you expect?

System.out.println(((Variable) module.getContext().getFrameStack().get(variable_name)).getValue());

Cheers,
Dimitris
Re: [EOL/ETL/ECL] How to exchange variables [message #1374633 is a reply to message #1372463] Thu, 22 May 2014 18:40 Go to previous messageGo to next message
Alexander Fülleborn is currently offline Alexander FüllebornFriend
Messages: 132
Registered: April 2013
Senior Member
Hi Dimitris,

thanks for your proposal. I get the right value, e.g. '100', now. But how can I calculate with this?

The following works:
Variable v = (Variable) module.getContext().getFrameStack().get(variable_name)).getValue();

But then, it is not possible to do something like:
v = v + 10;

Thanks and kind regards, Alex
Re: [EOL/ETL/ECL] How to exchange variables [message #1376372 is a reply to message #1374633] Fri, 23 May 2014 11:34 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 Alex,

Does the following help?

Variable v = (Variable) module.getContext().getFrameStack().get(variable_name));
Integer value = (Integer) v.getValue();
value = value + 5;

Cheers,
Dimitris
Re: [EOL/ETL/ECL] How to exchange variables [message #1376518 is a reply to message #1376372] Fri, 23 May 2014 12:58 Go to previous message
Alexander Fülleborn is currently offline Alexander FüllebornFriend
Messages: 132
Registered: April 2013
Senior Member
Hi Dimitris,

yes, this works fine! Thanks a lot for the solution!!!

Kind regards, Alex
Previous Topic:[Emfatic] syntax for enums/key value
Next Topic:Example of running ETL trafo from java?
Goto Forum:
  


Current Time: Thu Apr 25 02:24:38 GMT 2024

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

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

Back to the top