Integration and Deployment

Service Deployment

RESTful Web Services

Turn the same Excel-based decision model into an HTTP service that accepts JSON requests and returns explainable decision results.

Two deployment options

Select the runtime without changing the rules.

OpenRules REST is a lightweight implementation based on Undertow; the sample project is VacationDaysRest. The Spring Boot option uses VacationDaysSpringBoot. Both samples are included with OpenRules.

Add deployment=rest or deployment=spring-boot to project.properties, then run runLocalServer.bat. The first run installs the required framework libraries, builds the model, and starts the local endpoint.

OpenRules decision model deployed as a RESTful web service
Decision model to RESTful serviceOpen full size ↗

Local testing

Exercise the endpoint with the supplied tests.

Run testLocalServer.bat to send a generated request to the service. Results appear in both the server and client consoles.

OpenRules REST local server console
Local REST serverOpen full size ↗
OpenRules REST client and server test output
Generated REST testOpen full size ↗

Clients and packaging

Call from Java or ship an executable JAR.

SampleGeneratedClient.java shows how a Java application invokes the deployed decision service. The service can also be exercised with POSTMAN.

Run package.bat to create an executable JAR in target. Start that artifact on any local or remote server with java -jar; it is also ready for upload to a cloud repository.

Java client code for an OpenRules REST service
Generated Java REST clientOpen full size ↗
Spring Boot decision service console
Packaged Spring Boot serviceOpen full size ↗
POSTMAN test of the Vacation Days REST service
Testing the REST service with POSTMANOpen full size ↗

Build and deploy

Try these deployment projects yourself.

The free evaluation includes ready-to-run decision models that you can build, test, and adapt.