The JBoss Drools is a business rule management system solution. With the help of Drools business central, we can edit the drools rules on a web interface. We can also set up a KIE server to deploy the drools rules and invoke the deployed rules over HTTP. In this article, we will learn how to set up the JBoss Drools KIE business central and KIE server instance on a WildFly server.
The example uses the below version details of WildFly and drools war files.
- WildFly server version: wildfly-24.0.1.Final
- Drools Business Central: business-central-7.62.0.Final-wildfly23.war
- KIE Server war: kie-server-7.62.0.Final-ee8.war
Table of Contents
- Download and setup the WildFly server
- Setup the drools KIE-Server and KIE Business central
- Testing the drools business central kie server set up
Download and setup the WildFly server
Download the WildFly server from the official website.
Extract the downloaded zip file and navigate to the /bin folder of the extracted folder.
Create an admin user for the WildFly server. We can use the add-user.sh utility to add the admin user(add-user.bat if we are on Windows system).
The below image shows the user creation steps. We have created a Management User with the username kieadmin and added the user to the admin user group.
We can also use the below command to directly add a user instead of going through all those user creation steps.
./add-user.sh -a -u kieadmin -p kieadmin -ro admin
Create another application user that we will use for KIE business central login.
Here, we created an Application User with the username kieserver and with the user groups admin and kie-server.
We can also change the WildFly servers Java settings by allocating more memory space by updating the /bin folder’s standalone.conf configuration file.
We can replace the below line of the file,
JBOSS_JAVA_SIZING="-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m"
with the below line.
JBOSS_JAVA_SIZING="-Xms128m -Xmx2048m -XX:MetaspaceSize=512M -XX:MaxMetaspaceSize=1024m"
To test the WildFly setup, we can start the server by running the below command from the WildFly server’s /bin directory.
We are starting the WildFly server with all the server configurations enabled.
./standalone.sh -c standalone-full.xml
Once the WildFly server is successfully up and running, we can access the WildFly server at http://localhost8080, as shown below.
We can also access the WildFly server admin console at http://localhost:9990/.
Use the Management user credentials(kieadmin) that we created earlier to log in to the WildFly admin console.
Setup the drools KIE-Server and KIE Business central
The next step is to deploy the KIE business central and KIE server components.
We can download the required war files from the official website.
Here, I have choosen the WildFly 23 WAR from the Business Central Workbench section and ee7 war from the KIE Server WARS section.
Once the WAR files are downloaded, copy the war files to the standalone/deployment/ folder of the WildFly server.
I have also renamed the war files to kie-server and business-central after placing them under the deployment folder of the WildFly server.
Alternatively, we can use the WildFly admin console to deploy the WAR files. The below image shows the WildFly deployment console.
Now, start the WildFly server by executing the below command from the /bin folder of the WildFly server.
./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.user=kieserver -Dorg.kie.server.pwd=kieserver1! -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.server.controller.user=kieserver -Dorg.server.controller.pwd=kieserver1! -Dorg.kie.server.controller.location=http://localhost:8080/business-central/rest/controller -Dorg.kie.server.id=wildfly-kieserver &
With the above command, we are passing the below system properties to the WildFly server. These properties are used by the drools business central and KIE server applications.
- –server-config=standalone-xml: Used to start the WildFly server on full mode.
- org.kie.server.id: A unique KIE server identifier. We are setting this property to wildfly-kieserver.
- org.kie.server.user: Username to be set to access KIE server. It’s kieserver in our example. This is the application user we have created earlier.
- org.kie.server.pwd: Password to access the KIE server. This is the password of the WildFly application user(kieserver), that we have created earlier.
- org.kie.server.location: HTTP location where the KIE server gets exposed.
- org.server.controller.user: Username for accessing the KIE REST API.
- org.server.controller.pwd: Password for accessing the KIE REST API.
- org.kie.server.controller: The KIE REST server location. This URL used by the client applications to invoke the drools rules, that are deployed on the KIE server.
We can also set the system properties from the WildFly server admin console.
Testing the drools business central kie server set up
After the successful deployment of the wars and WildFly server setup, we can verify the KIE server by invoking the below URL.
And we get a screen similar to the below image.
We can now access the drools business central using the below URL.
The below image shows the login screen of the drools business central.
Use the credentials that we have set as system property earlier to log in to the drools business central.
After successful login, we can use the drools business central UI to create and deploy our drools rules.
In this article, we saw how to set up a single WildFly instance on a local machine.
We also learned how we can set up drools KIE server and business central applications on WildFly server that can be used for drools rules creation and deployment.