Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext DSL used as a Java Scripting Engine language(Is it possible to use a Xtext created language in java via the ScriptingEngine (as for Javascript))
Xtext DSL used as a Java Scripting Engine language [message #1245291] Thu, 13 February 2014 15:35 Go to next message
claudio rosati is currently offline claudio rosatiFriend
Messages: 5
Registered: June 2013
Junior Member
Hi everybody,
I working on an "assessment builder" and I need to store in certain cases some rules to auto-answer to questions (Ex. the simplest one is to answer with the current year or date). The rule would be stored on a db table.

My first choice was to write the rule in "javascript" and run it via java ScriptingEngine. But...

I'm starting to use xtext to build a rule language for another module of the same application so I'm guessing if it's possible to use the same new "DSL" as a ScriptingEngine language instead of Javascript.

Thanks,
Claudio
Re: Xtext DSL used as a Java Scripting Engine language [message #1245744 is a reply to message #1245291] Fri, 14 February 2014 07:32 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 248
Registered: June 2013
Senior Member
what about extending your DSL so it covers the complete assesment builder?
Re: Xtext DSL used as a Java Scripting Engine language [message #1249875 is a reply to message #1245744] Tue, 18 February 2014 18:27 Go to previous messageGo to next message
claudio rosati is currently offline claudio rosatiFriend
Messages: 5
Registered: June 2013
Junior Member
Uli Merkel wrote on Fri, 14 February 2014 02:32
what about extending your DSL so it covers the complete assesment builder?


This is somenthing we were tempted to do but finally there were other interaction (with other applications) that brought us to the decision of a old "db configuration".

So at the moment we have to configure the rules onto db columns and they have to be executed at runtime (depending on client answers on the assesment).

Thanks,
Claudio
Re: Xtext DSL used as a Java Scripting Engine language [message #1250792 is a reply to message #1245291] Wed, 19 February 2014 16:04 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 13/02/14 16:35, schrieb claudio rosati:

> I'm starting to use xtext to build a rule language for another module of
> the same application so I'm guessing if it's possible to use the same
> new "DSL" as a ScriptingEngine language instead of Javascript.

Sure, all you need to have is an interpreter for your rules.
A simple exmaple for an interpreter is included within the simple
arithmetics example. A more advanced one is shipped with Xbase.

Sven

--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Previous Topic:XXJvmModelInferrer is not getting called
Next Topic:Use Xtext index to filter linked resources
Goto Forum:
  


Current Time: Sat Oct 24 21:08:18 GMT 2020

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

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

Back to the top