A simple rule service to validate Hello
fact and testing it using Scenario Simulation.
An injectable KieRuntimeBuilder is generated, so you can create Drools v7 KieBase and KieSession out of it.
You will need:
mvn clean compile spring-boot:run
mvn clean package java -jar target/rules-legacy-scesim-springboot-example.jar
The Swagger page shows all the available endpoints, and it could be used to test them. You can take a look at the OpenAPI definition - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available Swagger Editor.
In addition, various clients to interact with this service can be easily generated using this OpenAPI definition.
Once the service is up and running, you can use the following examples to interact with the service.
Returns approved Hello from the given fact:
curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"approved":false, "greeting":"foo"}' http://localhost:8080/find-approved
or on windows
curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"approved\":false, \"greeting\":\"foo\"}" http://localhost:8080/find-approved
As response the modified Hello is returned.
Example response:
{"greeting":"foo","approved":true}
Returns denied Hello from the given fact:
curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"approved":false, "greeting":"bar"}' http://localhost:8080/find-approved
or on windows
curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"approved\":false, \"greeting\":\"bar\"}" http://localhost:8080/find-approved
As response the modified Hello is returned.
Example response:
{"greeting":"bar","approved":false}
Test Scenario + rules project created inside Business central should work, with the following requirements:
kogito.sources.keep
variable to true
Requires org.drools:drools-xml-support
dependency For the moment being, “globals” are unsupported