Table of Contents |
---|
Introduction
In rev. 1298461 and 1298908 I have committed some enhancements to the Groovy service engine and event handling to let the system inject a base class for all the Groovy scripts. The classname is configurable in the service engine.xml file: a first version of it with an initial but already usable implementation of a OFBiz DSL (Domain Specific Language) for Groovy services.
...
Info |
---|
As mentioned above, the DSL for services and events is available out-of-the-box. In order to enable the DSL also for data preparation scripts you'll have to apply the patch that is attached to this page (groovy-dsl-for-data-prep.patch); this work is still experimental and will be committed to the trunk once we will be sure that it doesn't affect the performance of script execution. |
...
Example
An example is worth of 1000 words: in In the following two sections we will compare examples of business logic implemented as a Minilang service and as a Java event have been converted to Groovyto the equivalent version implemented with the Groovy DSL.
Services
This is the original Minilang service:
...