Set up Drools Business Central and KIE Server on WildFly

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

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.

add wildfly admin user

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.

Set up Drools Business Central 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.

WildFly server home page

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.

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.

drools kie business central and kie server

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.

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.

drools kie server wildfly system properties

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.

http://localhost:8080/kie-server/services/rest/server

And we get a screen similar to the below image.

kie server test

We can now access the drools business central using the below URL.

http://localhost:8080/business-central/kie-wb.jsp

The below image shows the login screen of the drools business central.

drools business central login screen

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.

business central home page

Conclusion

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.

Set up Drools Business Central and KIE Server on WildFly
Scroll to top

Discover more from ASB Notebook

Subscribe now to keep reading and get access to the full archive.

Continue reading