Chapter 1: Create a Basic Process Model, App and Deploy

Create the Process

In Flowable Design, go to the Processes section and select the Create process button. In the dialog, name the process model "Leave Application", set the key to leaveApplication and optionally add a meaningful description of the process model.

Create a Process model

Once created, the process editor opens, and we can start defining our Leave Application process.

Add Pool, Lanes and User Tasks

By default there is a Start event, so we could go ahead and directly start defining the process, however, it is always a good practice to use pool and lanes to define the roles involved in a process. So delete that Start event and then drag and drop a Swimlanes  Pool/Lane element onto the process canvas. We can name that pool the same as the process Leave application process. By default, one lane is defined, so double-click its label and name it Employee. Add another lane by dragging and dropping a "Pool/Lane" element again below the existing lane (drop it once you see that green box below the existing lane). Name that lane Supervisor.

Drag and drop a Start events  Start event to the Employee lane where we want to start the process, then click the small User task icon on the right of the Start event to directly add a User task. Name the task, Request leave. Now, click the small user task icon on the right of this User task to directly add another User task and drag it into the Reporting Manager lane. Name it Review leave request. Click the End event icon on the right of this user task to directly add the End event to the same lane.

The diagram now looks like the following:

Add pool

Create Leave Application App and Publish it

To deploy our process model, we need to include it in an App that we can then use as a deployment unit. An App is a container of all the items related to a specific process and in this example, all the content related to the process model we are building.

Save the process model, and go to the Apps section of Flowable Design and select the Create app button.

Set the app definition name to Leave Application, the key to leaveApplicationApp and optionally add a meaningful description of what the app contains.

Create the Leave Application app

Once created, you are in the app editor. Select the Edit included models button to define what we want to add to the app.

In the BPMN models tab, click our newly created process model: "Leave Application". The model should be the first one in the list as it was the most recently edited model.

Models included in the app definition

That is it. Now you can Close the dialog, click the Save icon, and choose Save and close editor.

You should now see our newly created app in the list. Select it and click the Publish button. To successfully publish the app requires that Flowable Design is configured to publish (deploy) to your local runtime environment or wherever you want to run and test your app.

First Run of the Leave Application Process

Now that we have published the very first and basic version of our app let us run it and create the first process instance.

Go to the Flowable Work runtime, log in, and select Work  Create new item in the left-hand side menu. Choose our "Leave Application" in the dialog and confirm the creation of a new process instance.

You should now see your first process instance in the inbox and the process details. The Open tasks list already contains the Request leave user task.

Process instance runtime

Although this task does not have a task form attached to it as of now, it can still be completed. Select the menu:Tasks item and then the Complete. On completion, the next user task, Review leave, is displayed in the Tasks  Open tasks list, and this can also be completed.

As we did not link any forms to these user tasks, there was nothing to be entered for these tasks. However, do not worry; we are going to change that behavior in the next chapter.