Skip to main content



      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 10:35 Go to next message
Eclipse UserFriend
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 02:32 Go to previous messageGo to next message
Eclipse UserFriend
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 13:27 Go to previous messageGo to next message
Eclipse UserFriend
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 11:04 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 17:48:19 EDT 2025

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

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

Back to the top