23 February 2015

Setting up Drools Workbench and Execution Server (6.2.0.CR4)

Get Wildfly-8.1.0.Final.zip and unzip it into a directory. Then add three user names before start up.
Use the /bin/add-user.sh (or .bat) script to add three users.
These settings by default are stored in:

/standalone/configuration/mgmt-users.properties and application-users.properties

with the passwords hashed.

Use the $WILDFLY_HOME/bin/add-user.sh (or .bat for Windows) script to add three users.
The first user will become Admin on Wildfly and will be stored in mgmt-users.properties:
*What type of user do you wish to add?
Insert a
*Enter the details of the new user to add.
Username: admin
Password: xxxxxxxx
*What groups do you want this user to belong to? (Please enter a comma separated list,
or leave blank for none)[ ]:
Just leave this blank by hitting enter
*Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection
for server to server EJB calls.
yes/no?
Insert no

Now we have our Wildfly Admin. Next up is the Drools Workbench user with admin rights.
*What type of user do you wish to add?
Insert b
*Enter the details of the new user to add.
Username: wb-user
Password: xxxxxxxx
*What groups do you want this user to belong to? (Please enter a comma separated list,
or leave blank for none)[ ]:
Insert admin
*About to add user 'wb-user' for realm 'ApplicationRealm'
Is this correct yes/no?
Insert yes
*Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for
server to server EJB calls.
yes/no?
Insert no

So, this is our Drools Workbench user. The last user is needed for the Drools execution server.
*What type of user do you wish to add?
Insert b
*Enter the details of the new user to add.
Username: ks-user
Password: xxxxxxxx
*What groups do you want this user to belong to? (Please enter a comma separated list,
or leave blank for none)[ ]:
Insert kie-server
*About to add user 'wb-user' for realm 'ApplicationRealm'
Is this correct yes/no?
Insert yes
*Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for
server to server EJB calls.
yes/no?
Insert no

To use one user for Drools Workbench and Execution server, combine the groups.

Start Wildfly using /bin/standalone.sh (or .bat for Windows) and browse to
http://127.0.0.1:9990 and log in as Wildfly admin.
Now we need to download the Drools Workbench and Execution server .war files.
They are locared in the Jboss Release repository under:
https://repository.jboss.org/nexus/index.html#view-repositories;releases~browsestorage.
Navigate in the lower panel to org/kie/kie-drools-wb-distribution-wars/6.2.0.CR4
and download the wildfly8.war file. For the Kie server navigate to
org/kie/kie-server-distribution-wars/6.2.0.CR4 and download the
kie-server-distribution-wars-6.2.0.CR4-ee6.war or -ee7.war file according to the
Java Enterprise version in use. Use the Wildfly Management to load and enable the two war files.
The Wildfly log files can be found under /standalone/log.
Login to the Drools Workbench user the second user:
http://localhost:8080/kie-drools-wb-distribution-wars-6.2.0.CR4-wildfly8/
(I have issues loading the Workbench in Chrom and Firefox, but IE seems to work fine)
All that is left is to test the Kie server deployment, type the following url into the browser
and login using user number 3:
http://localhost:8080/kie-server-distribution-wars-6.2.0.CR4-ee7/services/rest/server
If succesfull you wil get the following response:

<response msg="Kie Server info" type="SUCCESS">
<kie-server-info>
<version>6.2.0.CR4</version>
</kie-server-info>
</response>

The Execution server is registered with Drools Workbench under menu item Deploy/Rule Deployments and then Register (on the right of the Window).
Endpoint:
http://localhost:8080/kie-server-distribution-wars-6.2.0.CR4-ee7/services/rest/server
Name:
container-name
Username
ks-user
Password
xxxxxxxx
and Connect.

This will create a named Container to deploy and execute the Rules.

Have fun!

4 comments:

  1. Can you give a java example of how to invoke and use this container

    ReplyDelete
    Replies
    1. Take a look at the Drools github account for a java REST client: https://github.com/droolsjbpm/droolsjbpm-integration/tree/master/kie-server-parent/kie-server-client

      Delete
  2. Perfect Tutorial . . !

    Thanks
    Tushar S

    ReplyDelete