Skip to main content

Building a workflow

FA Platform provides Flowable process engine as a standalone microservice. The engine allows you to define your workflows using BPMN 2.0 definitions, and with the Flowable modeler, you can create workflow definitions without having to write them in XML. To learn more about Flowable, see the documentation on the Flowable site.

To create a workflow, you model it by choosing and configuring elements, such as tasks and events, and connecting them to form a workflow. You can then deploy the workflow by publishing an app with the model.

Create a workflow model

To create a workflow model:

  1. Open the Process modeler view in the FA Developer app, go to the Processes tab, and click Create process.

  2. Define the model name and the model key (a unique identifier that can be used to launch the process via GraphQL) and click Create new model.

    You can now start creating the workflow definition with the visual editor. When you start the editor for the first time, you can edit the main configurations of the workflow at the bottom of the screen. You can access them later by clicking on an empty spot on the model canvas.

  3. In the visual editor, create a workflow model by adding BPMN 2.0 elements, defining their configurations, and connecting them with sequence flow arrows: 

    • Add an element to your model from the menu on the left side, and drag and drop it into the model canvas. 

    • Define configurations for the elements at the bottom of the screen when it is selected.

    • To create a sequence flow from one element to another, select an element and drag and drop the arrow icon appearing on its right side onto another element. 

  4. Save your model once you finished editing.

BPMN elements in FA workflows

This section provides an overview of the BPMN 2.0 elements (constructs) supported by Flowable that are commonly used in FA workflows. 

Events

Name

Function

Start event

Indicates the starting point of the workflow.

Intermediate event registry catching event

Continues the workflow upon receiving a signal.

End event

Ends the current process execution path.

Terminate end event

Terminates the process instance.

Tasks

Name

Function

User task

The user performs a task using an application interface, such as form.

Service task

Launches a service depending on the delegate expression defined in task configuration:

  • ${importer} - Import data to FA Back

  • ${reports} - Generate documents with JSReport

  • ${reporter} - Import generated JSReport to FA Back

  • ${files} - Import user's attached files to FA Back

  • ${API} - Fetch data from an API

  • ${roaring} - Fetch data from Roaring

Decision task

Triggers the rules defined in the referenced decision table. 

Deploy a model

To deploy a model, you need to create an app containing it. You can do this on the Apps tab of the Process modeler view by following these steps:

  1. Click Create App and define the app definition name and key. 

  2. Choose Edit included models to select the model for the app.

  3. Save the app and close the editor. 

  4. Select the app again and click Publish.

Your model is now deployed and ready to be used.

Notice

You can include multiple models in a single app. Publishing the app will then deploy all the models at once.

Caution

If you make any changes to your model, the application must be re-published for the changes to take effect. If you save a new version of your model instead of overwriting the previous one, you should also change the model version under the app.

Automated deletion of process instances

In FA, old Flowable process instances are automatically deleted. FA does this to prevent the accumulation of unfinished instances from affecting system performance. By default, a process instance is deleted after 60 days from when it was started. FA checks for and deletes old instances daily at 10pm.

You can postpone the deletion of a process instance by setting an execution variable named keepAliveUntilDate with a date (java.util.Date object) as value. As a result, the process instance is deleted only after the set date has passed.