Implementing Services

Services may be implemented—that is, developed in any language—for which there is a corresponding Service implementation engine. As of this writing, Service Engines supported include, but are not limited to: Java, Groovy, BeanShell, Mini-Language, Jacl, Javascript, JPython.

Getting ready

Before starting work on any new Service, you must first decide which tool to use to develop your Service. For simple database read, write, and update processing, you may want to use the OFBiz Mini-Language tool to develop "simple Services". Simple Services consist of one or more XML declarations instructing OFBiz on how to handle business processing tasks.

For those who prefer to use procedural languages such as Java or Groovy, these options are available as well.

How to do it...

To implement a Service definition, follow these steps:

  1. Create a new Service definition.
  2. Create the Service implementation using a tool of choice (Java, Mini-Language, Groovy).
  3. For Java Services, you must rebuild the component containing the Java code. For Mini-Language and other scripting tools such as Groovy, there is no need to rebuild the Component.
  4. Restart OFBiz.
  5. Test the Service definition.

How it works...

A Service's Service definition describes to OFBiz how a Service is implemented and where it is located on the runtime CLASSPATH. To create a new Service requires only an implementation of the Service (using a supported programming tool) and a proper Service definition entry in a valid Service definition file.

There's more...

Service Engines are configured in the following file:

~framework/config/service/serviceengine.xml
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.186.143