jBPM is the open source solution for workflow engine where complex business process can be defined and executed. Drools is the business rules management system (BRMS) based rules engine. KIE (Knowledge Is Everything) is the new name for Drools, jBPM and related technologies.
Often its challenging and time consuming to get started with the Web version of the Workbench. In this series I will talk about how to setup the KIE Workbench, develop and execute simple business processes using guided and DRL rules, which should save you a lot of time.
In this first part we will create a very basic business flow, then deploy and test it. We will then create more complex process in next part.
So let’s get started with jBPM KIE and Drools Workbench.
We will download and install the war file of the KIE workbench in JBOSS Server.
As I am writing this article, the latest version is 6.3, however I am facing a small issue with the wildfly (the new JBOSS) server in my MAC, so I will be using the old JBOSS 7.1.1 server and the 6.2 kie-wb-distribution-wars-6.2.0.Final-jboss-as7.war
file.
Install JBOSS Server:
Download the JBOSS Server, you can try the latest wildfly9/8 server. I had problem while using Process Model with El Capitan, however it worked fine in Windows 7.
Setup Wildfly9/8 or JBOSS 7.1.1:
The new name for the JBOSS Server is Wildfly9/8. Download it from the below link.
Get the JBOSS 7.1.1 from the below URL.
http://jbossas.jboss.org/downloads
Exact URL:
http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
Extract the zip file. Make sure the path does not have any space in it. Open the /standalone/configuration
folder and rename the standalond.xml
to standalone_old.xml
. Then again rename the standalone-full.xml
to standalone.xml
Now open the /bin
folder and execute the add-user.sh
or add-user.bat
. We need to add two users, one for accessing the admin console of the app server and another for using the KIE Workbench.
At first, lets add the Management User (Option [a]), we will use this id to access the Admin Console. When prompted, enter the user name and password. I have highlighted the data entered by me.
Now add another user, this time enter option b (Application User). When asked, enter role as admin
.
Now start the standalone.sh
or standalone.bat
, your server should be up and running.
Note: In case you are using JBOSS 7.1.1 in MAC and you have JDK version 7 or 8 setup then the server won’t start. There is an issue with JBOSS 7.x server with the JDK 7/8. In order to fix this, you need to set the default JDK to 1.6. In windows this is very easy, you can just change the PATH
variable.
If you already know how to change the default JDK in Mac then skip the following part.
Change the default JDK in Mac:
Add the following in your .bash_profile
file.
1 2 3 4 |
jvm() { export JAVA_HOME=`/usr/libexec/java_home -v "$1"` java -version } |
Restart the terminal, then you should be able to change the JDK by the command below.
jvm 1.6*
Access the server by using the following URL:
Then Click on Administration Console
, enter the Management User ID (user3 in my case) and related password. You should now see the admin console.
Download the kie-wb-distribution-wars from the below Maven repository. I will be using the 6.2.0. Final version for released in Mar 2015.
http://repo1.maven.org/maven2/org/kie/kie-wb-distribution-wars/
If you are using Wildfly then download the wildfly8 war, however I have downloaded the kie-wb-distribution-wars-6.2.0.Final-jboss-as7.war
file.
Now deploy the war file from the admin console. The URL will be the name of the war file.
http://localhost:8080/kie-wb-distribution-wars-6.2.0.Final-jboss-as7/
KIE Workbench Interface:
Login using the Application User ID (user4 in my case) and related password. The landing page should be as below.
The menu on top also have been expanded in the dashboard. Let’s talk about few of them.
Authoring -> Project Authoring:
This is the most important functionality. All the business process and rules will be created here.
Authoring -> Administration:
You can create the project repository here.
Deploy -> Process Deployments:
You can find all the deployed processes here.
Process Management -> Process Definitions:
The deployed process definitions will be listed here.
Process Management -> Process Instances:
Each process instances will be listed here.
Tasks -> Tasks List
All the tasks assigned to users will be displayed here.
Create Repository:
Let’s start with creating a repository. Go to Authoring -> Administration
. Click on Organizational Units-> Manage Organizational Units
.
Now click on Add, enter the following details and click on Ok.
Then click on Repositories -> New Repository
. Now click on Authoring -> Project Authoring
.Click on demo and select adeveloperdiary from the dropdown.
Create Business Process:
We will now create a sample business process. Click on New Item-> Project
. Enter name as MyProject
, click on Ok
and then click on Finish
. Once you create a project the Project Editor will be opened by default. Remember you can deploy a project from the project editor only.
Now click on New Item->Business Process
, enter Business Process as sample1
and package as adeveloperdiary.myproject
. Click on Ok
.
The process modelling tools will be opened at the right side. We will now create a sample process and test it.
Select the green circle, then you should see the options displayed there.
Click on the square rectangle, that should create a task. Double click on it, then enter Sample
as the name. Select the task and you should see an option icon below it. Click on it and select User Task
. There are different type of task type you can select from the list, we will learn bit more about them later.
Now select the Sample task again and once you move your mouse to the right side icons you can see a circle. Click on it. That should create a red circle, which will indicate end of our process flow.
Now Click on the save icon from the toolbar and click on save.
We need to assign the Sample task to one user since task type is User Task. Click on the Sample Task again and click on the small arrow at the right side, this bring up the property window.
Enter user4 in the Actors
, also Sample Task
as the Task Name
. Click on save.
Our task does not do anything, however let’s execute it.
Click on Open Project Editor
button at the left then click on Build->Build & Deploy
.
Execute and Test:
Click on Process Management-> Process Definitions
. Click on the the start icon in Action
column. Click on Submit from the popup. We didn’t set a name for the process, so the default name evaluation will be displayed. Click on Submit.
Now click on Process Management-> Process Instances
, click on the instance and the right panel should display the details about the Process Instance. Click on Options -> Process Model
.
This is a very important functionality, you can how our business process is getting executed here. The process has been started, it’s waiting on our user task. Let’s complete that.
Click on Tasks-> Tasks List
, you should see the Sample task is waiting for the user4 to complete. Click on the task and the right panel should open. Click on Start, there is nothing much to do here, so click on Complete. Now Go back to Process Instance and you can find the process in Completed Tab since it has already been completed. Click on it and verify the Process Model, you can see all the steps have been grayed our since we have completed our process.
We need to un-deploy the process to make change and deploy again. Click on Deploy-> Process Deployments
and click on the un-deploy
icon from the Action column. Note, if you have any instance running them you need to stop that before you can un-deploy any process.
We went through all the steps here, from creating a business process to deploy and test it. In the next part we will learn how to create more complex process and define rules for each task.
Philippe Raynal says
Hello A Developer Diary,
I used the last version 6.3 build in http://repo1.maven.org/maven2/org/kie/kie-wb-distribution-wars/ but this version doesn’t contains JBPM features like Dashboard and Process management functions !!!!
Except these problems, my first concern about KIE workbench with or without JBPM is how to execute a sample, except a test plan to validate, we haven’t some complete help to process a complete cycle, except with eclipse, but in this case the knowledge of maven is required.
However, drools.org said kie is appropriate for a business analyst ….. I’m one and I used some engine rules in the past, but I’m not sure this is for me, not about these possibilities … but too stuck to java, no sufficient abstraction layer focus on essentials.
Best regards
Phil
chris says
Hi A Developer Diary,
I am on 6.3 build and when tried the following step:
Now click on Process Management-> Process Instances, click on the instance and the right panel should display the details about the Process Instance. Click on Options -> Process Model.
pop window with message of ‘jBPM Web Designer loading, please wait…’ never mind.
Wonder if you could shed any light? Thanks.
Chris
A Developer Diary says
Hi Chris,
Could you please refer the server console log and look for errors? Sometime this may happen due to permission issue if you are in unix env. I had faced similar error.
shivam says
Hi,
I want to check server logs. Where to find these log file or Can I setup my own database on my own server. Currently i’m using Docker instance and whenever I kill the container instance, all of the data vanished. How to persist the data on my own database or server?
Janice says
Hi A Developer Diary,
I am having the same issue as Chris, and below is the snippet of the server log. I am on Windows environment. Do you happen have an idea what might be missing? Thanks.
2016-07-22 15:13:44,011 INFO [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (Thread-196) – Batch content: default://master@jwadeveloperdiary2/MyProject2/src/main/resources/adeveloperdiary2/myproject2/WorkDefinitions.wid (ADD).
2016-07-22 15:13:44,167 INFO [org.jbpm.designer.web.server.DictionaryServlet] (default task-11) Unable to find existing dictionary information.
2016-07-22 15:13:44,302 INFO [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (EJB default – 3) Batch incremental build request being processed.
2016-07-22 15:15:36,489 WARN [org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller] (default task-58) index=0, size=0
2016-07-22 15:15:36,626 INFO [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (Thread-196) Incremental build request received for: default://master@jwadeveloperdiary2/MyProject2/src/main/resources/adeveloperdiary2/myproject2/sample2.bpmn2 (updated).
2016-07-22 15:15:36,866 INFO [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (EJB default – 7) Incremental build request being processed: default://master@jwadeveloperdiary2/MyProject2/src/main/resources/adeveloperdiary2/myproject2/sample2.bpmn2 (updated).
2016-07-22 15:15:36,984 ERROR [org.drools.core.xml.ExtensibleXmlParser] (EJB default – 7) (null: 28, 31): cvc-complex-type.2.4.b: The content of element ‘bpmn2:ioSpecification’ is not complete. One of ‘{“http://www.omg.org/spec/BPMN/20100524/MODEL”:inputSet, “http://www.omg.org/spec/BPMN/20100524/MODEL”:outputSet}’ is expected.
2016-07-22 15:15:36,996 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (EJB default – 7) KieModule was added: MemoryKieModule[releaseId=adeveloperdiary2:MyProject2:1.0]
2016-07-22 15:17:02,888 WARN [org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller] (default task-5) index=0, size=0
2016-07-22 15:17:03,037 INFO [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (Thread-196) Incremental build request received for: default://master@jwadeveloperdiary2/MyProject2/src/main/resources/adeveloperdiary2/myproject2/sample2.bpmn2 (updated).
2016-07-22 15:17:03,245 INFO [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (EJB default – 6) Incremental build request being processed: default://master@jwadeveloperdiary2/MyProject2/src/main/resources/adeveloperdiary2/myproject2/sample2.bpmn2 (updated).
2016-07-22 15:17:03,383 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (EJB default – 6) KieModule was added: MemoryKieModule[releaseId=adeveloperdiary2:MyProject2:1.0]
2016-07-22 15:18:07,142 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (default task-15) KieModule was added: MemoryKieModule[releaseId=adeveloperdiary2:MyProject2:1.0]
2016-07-22 15:18:07,226 INFO [org.kie.scanner.embedder.MavenEmbedderUtils] (default task-15) Not in OSGi: using plexus based maven parser
2016-07-22 15:18:07,287 INFO [org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl] (default task-15) Deploying unit adeveloperdiary2:MyProject2:1.0
2016-07-22 15:18:07,389 INFO [org.jbpm.kie.services.impl.store.DeploymentSynchronizer] (default task-15) Deployment unit adeveloperdiary2:MyProject2:1.0 stored successfully
2016-07-22 15:19:16,708 INFO [org.jbpm.designer.server.EditorHandler] (default task-60) Performing diagram information pre-processing steps.
2016-07-22 15:19:16,711 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (default task-60) Performing preprocessing steps in readonly mode.
2016-07-22 15:19:16,806 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (default task-60) Successfully deleted file: C:\Users\Program\jbpm-installer-6.3.0\wildfly-8.1.0.Final\standalone\tmp\vfs\temp\temp35ae6535154d5f9d\jbpm-console.war-1f41aaefbdbe92e2\org.kie.workbench.KIEWebapp\stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json
2016-07-22 15:19:16,816 ERROR [stderr] (default task-60) context [anonymous] 6597:12 attribute includedo isn’t defined
2016-07-22 15:19:16,822 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (default task-60) Created file: C:\Users\Program\jbpm-installer-6.3.0\wildfly-8.1.0.Final\standalone\tmp\vfs\temp\temp35ae6535154d5f9d\jbpm-console.war-1f41aaefbdbe92e2\org.kie.workbench.KIEWebapp\stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json
2016-07-22 15:19:16,829 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (default task-60) Created file: C:\Users\Program\jbpm-installer-6.3.0\wildfly-8.1.0.Final\standalone\tmp\vfs\temp\temp35ae6535154d5f9d\jbpm-console.war-1f41aaefbdbe92e2\org.kie.workbench.KIEWebapp\stencilsets/bpmn2.0jbpm/view/activity/workitems/ReadOnlyService.svg
joao says
HI Have you fix the issue?
If yes ca you please tell me how?
Thanks
sangeetha says
Hi A Developer Diary,
I am trying to get kie workbench working in cloud(cloudfoundry). I tried working with docker, I am able launch workbench in local maching using docker, but due to lack of support for docker in my cloud env, I tried to push the war file. kie-wb-distribution-wars-6.3.0.Final-wildfly8.war.
Now, my drools workbench is running in cloud foundry, I am not sure how to launch it.
Need some guidance here how to get the login page.
hongxin says
Hi A Developer Diary,
i follow your document, and i can run the Administration Console ok. (because my local port 8080 is used , so it listen 9990 instead). Then i deploy the kie-wb-distribution-wars-6.2.0.Final-jboss-as7 through the administration console and the Deployment is enable , but when i open the url ‘http://localhost:8080/kie-wb-distribution-wars-6.2.0.Final-jboss-as7/’ , the browser only display “Generated by XFire ( http://xfire.codehaus.org )”. Then i find the windows-console(i user win7 os) tip :”unable to find class ‘org.kie.api.executor.Command'”. I want to login KIE Workbench, what can i do ? thank you ^_^
Josh says
I followed this tutorial on Windows 7 using the resources you specified and it worked fine and provided me with a really good overview of Drools.
It was very helpful. Thanks for writing it!
Christy Fernandes says
Hi There,
First of all i’d like to thank your for the great descriptive post.
I’m stuck at one point.
i have completed the below mentioned stage
“Now click on Process Management-> Process Instances, click on the instance and the right panel should display the details about the Process Instance. Click on Options -> Process Model”
i did get the pop up, the process model (the flow we designed). However what do we do next.
You have mentioned to go to task page and execute the task, but i have to close the process model block to access the task list. Once i close the process model popup, the task list is empty.
Can you please help me out here
David Coats says
I have gotten stuck on the step:
“Now click on Process Management-> Process Instances, click on the instance and the right panel should display the details about the Process Instance. Click on Options -> Process Model”
When I click on Process Model, it just gets hung on the popup window “Process Model” and it just says “jBPM Web Designer loading. Please wait….”
I’ve left it for at least 3 hrs and it never loads.
Any ideas what may be happening?
Amruta says
Hello,
I tried above given steps am facing some problem like in process definitions menu am unable to see my process which is created. my os is windows 10.
Ambarish Pande says
Have you tried deploying kie workbench on JETTY? Preferable embedded jetty?
Anu says
Really a very good and simple example to setup a business process in KIE Workbench… Keep posting these kinds of examples