The purpose of this project is to provide a proof of concept in relation to an screen flow handled by a set of rules in the following way:
- In an external system the end user enters project information and clicks Next.
- The Next button submits a new Process instance for the project using cloud_solution_projects.quote_cloud_solution from cloud_solution_projects kjar.
- The cloud_solution_projects.quote_cloud_solution process evaluates the received information with a set of rules and responds to the client application with the following results:
- The view-name that should be displayed next.
- An string representing recommendations based on the previous entered information.
- The client application presents to the user the next screen based on the received view name from step 3 and the user enters the next collection of information.
- The user submits the form again causing the process to evaluate the rules until all the required information for the project description is received.
- Once the quote information is completed, the process engine will evaluate the received information through a second set of rules, giving a price and a summary screen for the user to approve the quote or make any modifications to it.
- If the user approves the quote the quote process ends.
- During the process execution the client wants to be able to search any project using the information entered by the user.
These are the instruction for installing this project in your running KIE-SERVER:
- Clone the repository
$ cd ~
$ git clone https://github.com/diego-torres/BPMSRulesNSearch.git
- Add cloud-quote-model to your Maven repository.
$ cd ~/BPMSRulesNSearch/cloud-quote-model
$ mvn clean install
- Add the custom work item handler for scanning new versions of the rules projects to your Maven repository.
$ cd ~/BPMSRulesNSearch/cloud-rules-wih
$ mvn clean install
- Add the recommendation-rules kjar project to your Maven repository.
$ cd ~/BPMSRulesNSearch/recommendation-rules
$ mvn clean install
- Add the cloud-solution-projects kjar project to your Maven repository.
$ cd ~/BPMSRulesNSearch/cloud-solution-projects
$ mvn clean install
- Add a KIE-SERVER container with the cloud-solution-projects GAV
$ curl -X PUT -H "Accept:application/json" -H "Content-Type:application/json" --user kieserver:kieserver1! \
-d '{"release-id":{"group-id":"org.acme","artifact-id":"cloud-solution-projects","version":"1.0"}}' \
"http://localhost:8080/kie-server/services/rest/server/containers/cloud-solution-container"
- Test starting a process instance with project information.
- Start a the process instance.
$ curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" --user jboss:bpms -d '{"project":{"org.acme.cloud_solution_projects.Project":{"title":"test project title", "email": "[email protected]"}}}' \
http://localhost:8080/kie-server/services/rest/server/containers/cloud-solution-container/processes/cloud-solution-projects.quote-cloud-solution/instances
- Retrieve variables information.
$ curl -X GET -H "Accept: application/json" --user jboss:bpms \
http://localhost:8080/kie-server/services/rest/server/containers/cloud-solution-container/processes/instances/1/variables