Tasks

In BPMN, a task is an atomic activity within a process flow that represents work performed by a person or an application. Tasks are the fundamental elements that define the units of work in a business process.

Atomic means that it cannot be broken down further in the process model. If an activity can be decomposed into smaller units, a subprocess should be used instead.

Tasks are connected by sequence flows to define the order of execution within the process.

Task Types

BPMN defines several types of tasks to represent different behaviors and performers. These task types are graphically annotated with symbols in the top left corner of the task shape. The task types include:

Abstract Task

A task that does not have a specific type defined. It is used when the task’s behavior is not specified in detail.

Processes with abstract tasks can be deployed, but the task will be ignored by the engine.

User Task

Performed by a human user with the assistance of a software application.

Service Task

Uses a web service, automated application, or other service to perform the task.

Manual Task

Performed without the aid of any business process execution engine. Not supported in Jmix BPM.

Business Rule Task

Provides input to a business rules engine and gets the output.

Script Task

Executed by a business process engine by running a predefined script.

Entity Data Task

Allows to manipulate Jmix entities from within the business process.

Email Sending Task

Allows to send emails from within the business process.

Common Task Properties

Task Id

The task Id is generated automatically, you can change it to more meaningful. It helps to make logs be understandable better.

Naming Tasks

Tasks are typically named using a verb + object syntax, such as "Approve Order" or "Send Invoice".

Task name maximum length is 255 characters.

Additional Markers

Tasks can also be annotated with markers to indicate specific behaviors such as:

Looping

It indicates that a task will repeat until a certain condition is met. Not supported in Jmix BPM.

Multi-Instance

It indicates that a task will be executed multiple times, either in parallel or sequentially. See the Multi-Instance section for details.

Extension Properties

You can create for the task extension properties:

extension properties

In XML, extension properties are defined by jmix:property attribute:

<serviceTask id="service-task" name="Service Task" >
<!--    . . .   -->
<extensionElements>
<!--   . . .    -->
    <jmix:properties>
      <jmix:property name="color" value="red" /> (1)
    </jmix:properties>
  </extensionElements>
</serviceTask>
1  — Created extension property.

Execution Listeners

You can define execution listeners for the task:

create execution listner