Skip to content

Latest commit

 

History

History
98 lines (62 loc) · 3.56 KB

README.md

File metadata and controls

98 lines (62 loc) · 3.56 KB

Kie (Drools/DMN) Decisions Webapp client

Docker Repository on Quay

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

Webapp home page

The page will reload if you make edits.
You will also see any lint errors in the console.

Generating a Container Image

This needs to be performed in two steps:

1. Build the webapp using NodeJS webpack using the utility Nodeshift

Use the source-to-image CLI tool to easily generate an image containing your react app.

  • s2i CLI build usage
Usage:
  s2i build <source> <image> [<tag>] [flags]
s2i build . nodeshift/ubi8-s2i-web-app:latest rafaeltuelho/decision-service-s2i-webpack

2. Build the final webapp image

  • Build the final webapp using the Nginx base image
docker build -t quay.io/rafaeltuelho/decision-service-webclient .
  • to run this container
docker run -d --name decision-service-webclient -p 8081:8080 quay.io/rafaeltuelho/decision-service-webclient

Deploying on Openshift

   $ oc new-app quay.io/rafaeltuelho/decision-service-webclient -n rhpam-sandbox 
   $ oc expose service/decision-service-webclient
   $ echo "$(oc  get route decision-service-webclient --template='http://{{.spec.host}}')"

Demo the Sample Use Cases

The first thing you need to do is enter the connection settings to your Kie Server service. Click on the Gear icon located at the top right of the app to open the Settings page.

  • Enter the Kie Server Rest API URL and the credentials (kieserver/kieserver1!)

  • Click on the Drools and DMN link and enter the Kie (container) Deployment Unit details

Click on Test Connection button and then Save

Drools Business Rules

This use case makes use of a Drools Decision Table implemented using a XLS Spreadsheet representation

  • Enter the input data and hit Submit to see the Decision Service's response.

  • You can also see the client request and server response payload clicking on Debug link at the bottom of the web form.

DMN Models

There are two Decision Models you can play with:

  1. Traffic Violation

  1. Loan Approval
  • choose the decision model from the Dropdown and fill the data input form rendered.
  • hit Submit to see the Decision Service's response.