Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Validating Excel using Epsilon Java API
Validating Excel using Epsilon Java API [message #1837606] Wed, 03 February 2021 06:18 Go to next message
Hong Sun is currently offline Hong SunFriend
Messages: 4
Registered: February 2021
Junior Member
I am trying to use Epsilon Java API (https://download.eclipse.org/epsilon/2.2/javadoc/index.html) to validate Excel files.
But I could not find an example of this.
Can anyone please show me an example?
Thanks
Re: Validating Excel using Epsilon Java API [message #1837614 is a reply to message #1837606] Wed, 03 February 2021 08:31 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Hong,

Please see [1] for instructions on running Epsilon programs for Java and [2, 3] for examples that show how you can load Excel spreadsheets [4] programmatically. If you have any further questions, please let me know.

Please note that as per [4], there's a regression in the Excel driver in 2.2 so you'll have to use either Epsilon 2.1 or the latest interim version instead.

Thanks,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/run-epsilon-from-java/
[2] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/tests/org.eclipse.epsilon.emc.spreadsheets.test/src/org/eclipse/epsilon/emc/spreadsheets/excel/ExcelModelTest.java
[3] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/tests/org.eclipse.epsilon.emc.spreadsheets.test/src/org/eclipse/epsilon/emc/spreadsheets/excel/ExcelRowTest.java
[4] https://www.eclipse.org/epsilon/doc/articles/excel/
Re: Validating Excel using Epsilon Java API [message #1837647 is a reply to message #1837614] Wed, 03 February 2021 15:30 Go to previous messageGo to next message
Hong Sun is currently offline Hong SunFriend
Messages: 4
Registered: February 2021
Junior Member
Thanks Dimitris. Now I can use Java to read the content of Excel.
But I want to validate the Excel using a separate EVL file.
How can I do it?
Re: Validating Excel using Epsilon Java API [message #1837648 is a reply to message #1837647] Wed, 03 February 2021 15:32 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

You'll need to replace EolModule with EvlModule in your program and parse your .evl file instead.

Thanks,
Dimitris
Re: Validating Excel using Epsilon Java API [message #1837670 is a reply to message #1837648] Thu, 04 February 2021 02:34 Go to previous messageGo to next message
Hong Sun is currently offline Hong SunFriend
Messages: 4
Registered: February 2021
Junior Member
My code is like:
--------------------------------------------
EvlModule module = new EvlModule();
module.parse(new File(PATH_TO_EVL));
module.getContext().getModelRepository().addModel(worksheet.getModel());
module.execute();
---------------------------------------------
Is this correct?

Re: Validating Excel using Epsilon Java API [message #1837684 is a reply to message #1837670] Thu, 04 February 2021 07:51 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

This seems to be in the right direction. The argument of addModel should be an ExcelModel and you should have called its load() method before passing it to the EvlModule. Also, after execute() you can access unsatisfied constraints through module.getContext().getUnsatisfiedConstraints().

Thanks,
Dimitris
Re: Validating Excel using Epsilon Java API [message #1837716 is a reply to message #1837684] Thu, 04 February 2021 14:45 Go to previous messageGo to next message
Hong Sun is currently offline Hong SunFriend
Messages: 4
Registered: February 2021
Junior Member
Thanks, now I can use EVL to check my Excel file.

One more question:
I see module.execute() returns an object as the result.
But my program gets null.
What result should be returned here?
Re: Validating Excel using Epsilon Java API [message #1837727 is a reply to message #1837716] Thu, 04 February 2021 19:18 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Hong,

EvlModule's execute() doesn't return anything useful at the moment.

Thanks,
Dimitris
Re: Validating Excel using Epsilon Java API [message #1837774 is a reply to message #1837727] Sat, 06 February 2021 01:26 Go to previous messageGo to next message
Sina MadaniFriend
Messages: 160
Registered: November 2015
Location: York, UK
Senior Member
Execute returns the UnsatisfiedConstraints since 2.0.
Re: Validating Excel using Epsilon Java API [message #1837781 is a reply to message #1837774] Sat, 06 February 2021 09:46 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Sina is right - my bad.

Thanks,
Dimitris
Previous Topic:Simulink Requirements
Next Topic:Control-flow Feedback to Ant from Epsilon
Goto Forum:
  


Current Time: Sat Apr 27 09:27:02 GMT 2024

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

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

Back to the top