Create your first process with jBPM 6 Web designer

In this tutorial we will learn how to design a process from scratch using the jBPM6 Web designer or the business-central of its supported version, named Red Hat JBoss BPM

Prerequisites: You have an installed jBPM 6 or the supported version Red Hat JBoss BPM 6.

Reach the Web console:

Authoring a Process

In order to create a new process you have at first to define an Organizational Unit for it. From the top menu go to Authoring | Administration| Organizational Units | Manage Organizational Units.

Click Add to create a new Organizational unit, and provide a Name for it, the user in charge to admin the unit, and the Maven group name:

jbpm 6 tutorial

Next step will be adding a Repository. jBPM 6 uses an internal Git repository to store your projects. In order to create it, navigate through the menus, and go to Authoring | Administration | Repositories | New Repository. Enter a name for the repository, choose the organization unit and create the repository.

jbpm 6 tutorial

Create your process with the Web designer

It’s time to create your first process. Go to Authoring | Project Authoring. Select New Item and choose Project. At first you will choose the Project name:

jbpm 6 tutorial

Next enter the Project General settings as indicated in this picture:

jbpm 6 tutorial

Click on Finish. Now we will add our first process. Select New Item | Business Process and enter a name for the business process;

jbpm 6 tutorial

Now, the business console will show you the process modeler for designing your business processes.

jbpm 6 tutorial

The process modeler is made up of the following 4 parts:

  1. On the left side the Object library contains all the BPM components. Drag and drop them to include them in the process
  2. The Workspace on the center contains the process model
  3. The Property window on the right can be used to configure properties of the BPM components
  4. The Upper toolbar contains some typical options for saving, copy and past, export/import of the process

Building Your First BPM Application

We will now define a simple process which will contain a HumanTask to be completed and a couple of Script Task to debug the outcome of the status. Here is our process:

jbpm 6 tutorial

First of all, we have defined one Process variable named “approved” that will be later used to collect information from an Human Task.

jbpm 6 tutorial

Next, the process contains the Human Task which has been assigned to the bpmnAdmin user:

jbpm 6 tutorial

In the assignment window (you can reach it from the Property window of the Task), you can map in/out variables generated in the Human task. In our example, we are collecting one Boolean, the approved variable, which will be then stored in the corresponding Process variable.

jbpm 6 tutorial

The gateways are a basic example on how to control the process flow. It can lead to two different paths: the first one will be used when the variable approved is “true”:

jbpm 6 tutorial

On the other hand, when approved is “false”, the second path will be chosen:

jbpm 6 tutorial

The Script tasks are just there to debug our Process, including a System.out inside it:

jbpm 6 tutorial

Deploy and Run the process

Go to Authoring, click on Open Project Editor. Click Build & Deploy. Check that the build and deploy was successful, next move to Process Management | Process definitions. You should find the Process Definition :

jbpm 6 tutorial

Click on Start in order to launch a new instance of the Process. You will be able to enter some values for the process variables if any. The process will be visible in the Process Instances UI. Next move to the Tasks menu and verify that you have in charge the Task (if not check that the Actor you have assigned is the same user you have used for logging in the business console):

jbpm 6 tutorial

At first start the Task:

jbpm 6 tutorial

 Next fill up the auto-generated form with the approved parameter and click on Complete.

jbpm 6 tutorial

Now the process will end, verify from the Server logs that the process has gone through the right path:

12:24:23,995 INFO [stdout] (http-/127.0.0.1:8080-17) Process approved!!

That’s all! In the next tutorial we will learn how to fire and control your Process instances through the REST API.

Found the article helpful? if so please follow us on Socials