Getting started with Flowable
I'm working on a proof-of-concept that needs to provide runtime support for the execution of business processes.
Luckily for me there are quite a few open source workflow engines to choose from.
I thought I'd start by taking a look at Flowable.
Getting Started
The easiest way to get started with Flowable is to use a Docker image, for example:
docker pull flowable/all-in-one
docker run -d --name flowable \
  -p 8080:8080 \
  flowable/all-in-one
The flowable/all-in-one image includes Flowable's web applications:
- Flowable Identity Management: http://localhost:8080/flowable-idm
- Flowable Modeler: http://localhost:8080/flowable-modeler
- Flowable Task: http://localhost:8080/flowable-task
- Flowable Admin: http://localhost:8080/flowable-admin
Navigate to the Flowable Task application: http://localhost:8080/flowable-task and you will be redirected to Flowable's Identity Management application. Sign in using the default user id: admin and password: test
  
You will then be redirected back to the Flowable Task application:
Click on the Task App card to view Flowable's Tasks list:
We haven't created any tasks yet so the Tasks list will be empty. Let's jump right in and create our first task, click the Create Task button and enter a name and a description:
Then click the Create button:
Now that we have successfully created our first task, lets take a quick look at Flowable's REST API.
Flowable REST API
The flowable/all-in-one image also includes Flowable's REST API.
For example, GET runtime/tasks
curl -i 'http://admin:test@localhost:8080/flowable-task/process-api/runtime/tasks'
You should see output like:
{
    "data": [
        {
            "id": "5df96793-fda4-11e8-aa29-0242ac110002",
            "url": "http://localhost:8080/flowable-task/process-api/runtime/tasks/5df96793-fda4-11e8-aa29-0242ac110002",
            "owner": null,
            "assignee": "admin",
            "delegationState": null,
            "name": "My First Task",
            "description": "My first Flowable task",
            "createTime": "2018-12-12T00:25:02.784Z",
            "dueDate": null,
            "priority": 50,
            "suspended": false,
            "taskDefinitionKey": null,
            "scopeDefinitionId": null,
            "scopeId": null,
            "scopeType": null,
            "tenantId": "",
            "category": null,
            "formKey": null,
            "parentTaskId": null,
            "parentTaskUrl": null,
            "executionId": null,
            "executionUrl": null,
            "processInstanceId": null,
            "processInstanceUrl": null,
            "processDefinitionId": null,
            "processDefinitionUrl": null,
            "variables": []
        }
    ],
    "total": 1,
    "start": 0,
    "sort": "id",
    "order": "asc",
    "size": 1
}
Note: The flowable/all-in-one image doesn't include Flowable's OpenAPI (Swagger) docs.
Flowable OpenAPI (Swagger) docs
The flowable/flowable-rest image includes the Flowable OpenAPI (Swagger) docs:
docker pull flowable-rest
docker run -d --name flowable-rest \
  -p 5001:8080 \
  flowable/flowable-rest
Navigate to: http://localhost:5001/flowable-rest/docs
To list all running containers:
docker container ls
You should see output like:
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                    NAMES
7e5bcf8817b2        flowable/all-in-one   "/opt/tomcat/bin/cat…"   35 hours ago        Up 17 hours         0.0.0.0:8080->8080/tcp   flowable
You can stop a container using the following command:
docker container stop [name]
For example:
docker container stop flowable
What's Next
In the next post, we'll use Flowable's Modeler to model a business process and Flowable's REST API to interact with process instances and User tasks.
Source Code:
- GitHub: Serendipity
Sample Code:
- GitHub: Flowable Examples
References:
- Paul Holmes-Higgin's blog: Instant Gratification with Flowable 6