KIE Server OptaPlanner Task Assignment
An example of assigning tasks on KIE Server using OptaPlanner.
- JDK 1.8 or above
- Maven 3.0+
- node.js 8.12+
- npm 6.4.1+
- KIE Server war file from OptaPlanner website (Execution server -> Any application server, unzip to find the war file)
Running the demo
First start a WildFly instance and deploy KIE artifacts:
- Download and unzip the WildFly distribution. Let’s call the root of the distribution WILDFLY_HOME. This directory is named after the WildFly version, so for example
wildfly-15.0.1.Finalis the one we're using for this demo.
- Download kie-server-...-ee7.war and place it into
- Configure user(s) and role(s). Execute the following command
WILDFLY_HOME/bin/add-user.sh -a -u 'kieserver' -p 'kieserver1!' -ro 'kie-server'. You can of course choose different username and password, just make sure that the user has role
- Start the server by running
WILDFLY_HOME/bin/standalone.sh -c standalone-full.xml. The default URI for KIE Server is http://localhost:8080/kie-server/services/rest/server. Check this location in a web browser to verify the server is running. You will be prompted to type in username and password, use the ones you chose when adding a new user.
Now that the KIE Server is running, let's deploy an OptaPlanner service to solve a task assignment problem.
- Copy the OptaPlanner service kjar to your local mvn repository, this can be done by typing the command
- Run the UI:
- Go to
npm installto install the dependencies.
npm startthis will start the frontend application. If it doesn't open in a default browser, open your favorite browser and go to
- Go to
- build the kjar:
cd task-assignment-kjar mvn install
- Run the kie server:
cp kie-server-...-ee7.war WILDFLY_HOME/standalone/deployments/kie-server.war WILDFLY_HOME/bin/add-user.sh -a -u 'kieserver' -p 'kieserver1!' -ro 'kie-server' WILDFLY_HOME/bin/standalone.sh -c standalone-full.xml
- Run the UI:
cd task-assignment-ui npm install npm start
Developing Drools and jBPM
If you want to build or contribute to a kiegroup project, read this document.
It will save you and us a lot of time by setting up your development environment correctly. It solves all known pitfalls that can disrupt your development. It also describes all guidelines, tips and tricks. If you want your pull requests (or patches) to be merged into master, please respect those guidelines.