Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » call java tool from epsilon(call java tool from epsilon)
call java tool from epsilon [message #1752108] Wed, 18 January 2017 21:32 Go to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi,

I followed the example that is available here https://eclipse.org/epsilon/doc/articles/call-java-from-epsilon/

It was working fine but I don't want to run the tool as an eclipse application then create a new EOL file because I am already have an EOL file in the Epsilon environment and I want that EOL to call the tool that I have created like the above tutorial .I tried to search the tools but I couldn't find it there .What should I do to allow my current EOL to call the tool that I created instead of creating a new EOL file .I hope that I have explained the problem clearly .Attached screenshot for what I have.

Thanks,
Taghreed

[Updated on: Wed, 18 January 2017 22:07]

Report message to a moderator

Re: call java tool from epsilon [message #1752148 is a reply to message #1752108] Thu, 19 January 2017 09:24 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Tools are contributed by plugins, so you need to have it installed in your Eclipse to use it (hence why you have to run a nested Eclipse application if you're using it from source).

You could try exporting the tool as a deployable plugin (using File > Export...), placing the .jar file inside the dropins folder of your Eclipse installation and then restarting Eclipse. You would need to redo this every time you change the tool, however.
Re: call java tool from epsilon [message #1752295 is a reply to message #1752148] Fri, 20 January 2017 16:58 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi Antonio,
Thanks .
Re: call java tool from epsilon [message #1765113 is a reply to message #1752295] Tue, 06 June 2017 18:40 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi,

I have the same question.
In my EOL program, I need to call EMFtoCSP [1]. How should I do it?

I installed EMFtoCSP but there is no related tool in my eclipse.
I also imported all the files in its plugin folder [2] to eclipse, change their JRE from 1.6 to 1.8, right click on one of them->Export-> Jar file-> select all of them->save, then I copy the saved file in the eclipse dropins folder. However, there is no related tools in eclipse.

[1]. https://github.com/SOM-Research/EMFtoCSP
[2]. https://github.com/SOM-Research/EMFtoCSP/tree/master/plugins


Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: call java tool from epsilon [message #1765256 is a reply to message #1765113] Wed, 07 June 2017 21:01 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
cannot anyone help me in this regard?

Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: call java tool from epsilon [message #1765257 is a reply to message #1765113] Wed, 07 June 2017 21:04 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi,

You need to export as "Deployable Plugins and Fragments" instead. Until you get the intended functionality to work as expected, an easier and faster way to run/test your plugin would be to right-click on it in the Project Explorer and select Run As -> Eclipse Application. This will launch a new instance of Eclipse which contains whatever plugins you have in your first instance + running copies of any plugin projects you have in your workspace.

Cheers,
Dimitris

Cheers,
Dimitris
Re: call java tool from epsilon [message #1765408 is a reply to message #1765257] Fri, 09 June 2017 09:33 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Thank you. I can see the tool when run plugin as eclipse application, but When I export it as "Deployable Plugins and Fragments" it is still not shown.

As another question, In your opinion, which constraint solver ( USE, EMFtoCSP, etc.) is more appropriate for Epsilon programs?

Due to the fact that e.g., in "FamiliestoPersons" program we have the constraint "Member.familyfather.isDefined()" which is not pure OCL to fed to the constraint solver, do you know any work that use constraint solver for epsilon programs?


Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: call java tool from epsilon [message #1765410 is a reply to message #1765408] Fri, 09 June 2017 09:43 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

> Thank you. I can see the tool when run plugin as eclipse application, but When I export it as "Deployable Plugins and Fragments" it is still not shown.

You may want to have a look at the Build tab of your MANIFEST.mf and make sure that all required artefacts are bundled in the exported plugin.

> As another question, In your opinion, which constraint solver ( USE, EMFtoCSP, etc.) is more appropriate for Epsilon programs?

I haven't used constraint solvers enough myself, but I've heard good things from peers I trust about USE.

Cheers,
Dimitris
Re: call java tool from epsilon [message #1766522 is a reply to message #1765410] Thu, 22 June 2017 15:22 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Thank you very much.

Dimitris Kolovos wrote on Fri, 09 June 2017 09:43

You may want to have a look at the Build tab of your MANIFEST.mf and make sure that all required artefacts are bundled in the exported plugin.


I don't have a Build tab in my MANIFEST.mf. e.g., I want to export this [1] plugin of haetae.

[1]. https://github.com/epsilonlabs/haetae/tree/master/org.eclipse.epsilon.haetae.eol.metamodel.visitor.printer


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Thu, 22 June 2017 15:23]

Report message to a moderator

Re: call java tool from epsilon [message #1766535 is a reply to message #1766522] Thu, 22 June 2017 18:30 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi,

You can add a build.properties file like [1] at the root level of the plugin and the "Build" tab should appear in your manifest editor. As this question seems to be about Haetae, I'd suggest creating an issue at Haetae's GitHub project.

Cheers,
Dimitris

[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/plugins/org.eclipse.epsilon.eol.engine/build.properties
Re: call java tool from epsilon [message #1798275 is a reply to message #1766535] Wed, 14 November 2018 19:47 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi there,

Although the tool is shown in Tools view, when I define a native variable and call its method, it has the 'method not found' error. The input of the method is correct. What shall I do?

Best Regards,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Wed, 14 November 2018 19:49]

Report message to a moderator

Re: call java tool from epsilon [message #1798278 is a reply to message #1798275] Wed, 14 November 2018 19:56 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Banafsheh,

Could you please provide a minimal example [1] we can use to reproduce this locally?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: call java tool from epsilon [message #1798302 is a reply to message #1798278] Thu, 15 November 2018 06:56 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
I have attached the minimal example.

Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: call java tool from epsilon [message #1798371 is a reply to message #1798302] Fri, 16 November 2018 09:47 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi Dimitris,

I appreciate your time in advance. If you import the files in the `first eclipse` folder to eclipse. Then, you run as an eclipse application, and import the files in the `second eclipse` folder to the new eclipse and run the `minimal`, you can see the error. I have changed the plugin.xmi of `org.eclipse.epsilon.haetae.eol.metamodel.visitor.printer`. If Dr. Wei also checks this forum maybe he can help me as well, though I do not think anything is wrong with haetae. I do not have a problem with the tool via standalone. I use Epsilon 1.3.
Looking forward to your prompt reply.

Best Regards,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Sat, 17 November 2018 07:09]

Report message to a moderator

Re: call java tool from epsilon [message #1798416 is a reply to message #1798371] Sat, 17 November 2018 19:33 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Banafsheh,

In my setup with 1.3 I'm getting a different error message reading:

Illegal assignment to variable 'pre'. Expected String and found org.eclipse.epsilon.eol.visitor.printer.impl.EolPrinter@563c3880
	at (/snip/FamiliestoPersons/test.eol@2:0-2:101)


which is expected given that "pre" is declared as a string in your code. Getting rid of the type declaration makes the program run with out errors

var model2code : new Native("org.eclipse.epsilon.eol.visitor.printer.impl.EolPrinter");
var pre = model2code.print(ETL!ETLModule.all.first().preBlocks.first.body.statements.first);
pre.println();


Cheers,
Dimitris
Re: call java tool from epsilon [message #1798419 is a reply to message #1798416] Sun, 18 November 2018 06:29 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi Dimitris,

To call the `print` method, I have the same error as you. Without declaring `pre` as a string, the error is disappeared but the output in the console is wrong. It prints `org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1eff8d2a (eClass: org.eclipse.emf.ecore.impl.EClassImpl@329e6d22 (name: ExpressionStatement) (instanceClassName: null) (abstract: false, interface: false))org.eclipse.epsilon.eol.visitor.printer.impl.EolPrinter@2954f38dorg.eclipse.epsilon.eol.visitor.printer.impl.EolPrinter@2954f38d
` while I expect to have `"Running ETL".println();` . The reason is it cannot detect the methods of `EolPrinter` class of `Haetae`. It confuses it with the `print` method of eol, this is why it does not give the `method not found` error. If you print something in the `print` method of the EolPrinter class, you can see nothing is printed in the console. It does not go through the methods of EolPrinter class, it only goes through the constructor of this class. If you call other methods of EolPrinter, such as the bellow code, you can see `the method not found` error.

var model2code : new Native("org.eclipse.epsilon.eol.visitor.printer.impl.EolPrinter");
model2code.run(odel2code.print(ETL!ETLModule.all.first().preBlocks.first.body.statements.first)).println();


Best Regards,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Sun, 18 November 2018 06:32]

Report message to a moderator

Re: call java tool from epsilon [message #1798420 is a reply to message #1798419] Sun, 18 November 2018 07:10 Go to previous message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi Dimitris,

It seems it is related to `Haetae`. I have tested it with the previous version of `Haetae` and it works well. I think the previous version of this tool supports for running it via EOL execution engine (it doesn't support for standalone) and the current version supports for standalone and not support for eol engine. As I finally want to use it via standalone it doesn't matter to me.
Sorry for any inconvenience,

Best Regards,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir
Previous Topic:Run Etl
Next Topic:Using Epsilon for OWL to Ecore/Java transformations
Goto Forum:
  


Current Time: Fri Mar 29 14:09:37 GMT 2024

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

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

Back to the top