zen-engine-service
v1.0.0
Published
Service for Zen Engine rules
Readme
Overview
This project provides an API service built with Express and TypeScript to handle business rules using the ZenEngine provided by GoRules. It simplifies the management and evaluation of business rules by providing endpoints for evaluation, retrieval, and storage.
Key Features
- Evaluate business rules using the GoRules ZenEngine.
- Save and retrieve JSON decision models (JDM).
- Modular validation and error handling.
JSON Rule Structure
A valid rule for ZenEngine requires the following structure:
{
"contentType": "decision",
"nodes": [
{ "id": "1", "type": "start" },
{ "id": "2", "type": "decision", "conditions": { "key": "value" } }
],
"edges": [
{ "from": "1", "to": "2" }
],
"settings": {
"type": "default",
"description": "Sample Rule"
}
}Scripts
npm run dev: Starts the development server using nodemon.
npm run build: Compiles the TypeScript source to JavaScript.
npm start: Runs the production server.
npm run prod: Runs the service directly with ts-node.Deployment
To deploy this service:
Build the project using npm run build.
Use a process manager like PM2 or a systemd service to start dist/index.js.SERVICE
VER SERVICIO: sudo systemctl status softseti-business-rules-engine.service PARAR SERVICIO: sudo systemctl stop softseti-business-rules-engine.service ENCENDER SERVICIO: sudo systemctl start softseti-business-rules-engine.service REINICIAR SERVICIO: sudo systemctl restart softseti-business-rules-engine.service
