Red Hat Training

A Red Hat training course is available for Red Hat Process Automation Manager

Chapter 4. BPMN2 tasks in process designer

A task is an automatic activity that is defined in the process model and the smallest unit of work in a process flow. The following task types defined in the BPMN2 specification are available in the Red Hat Process Automation Manager process designer palette:

  • Business rule tasks: Used to execute a set of business rules through the rule flow group
  • Script tasks: Used to execute a piece of code written in Java, JavaScript, or MVEL
  • User tasks: Used to include human actions as input to the business process

Table 4.1. Task

Business rule task

bpmn business rule task

Script task

bpmn script task

User task

bpmn user task

In additions, the BPMN2 specification provides the ability to create custom tasks. The following predefined custom tasks are included with Red Hat Process Automation Manager:

  • Rest service tasks: Used to invoke a remote RESTful service
  • Email service tasks: Used to send an email
  • Log service tasks: Used to log a message
  • WebService service tasks: Used to invoke a remote WebService call
  • DecisionTask tasks: Used to execute a DMN diagram

Business rule task

A business rule task defines a set of rules that are evaluated and fired on task execution. Any rule defined as part of the rule flow group in a rule resource is fired.

bpmn business rule task

When a process reaches a business rule task, the engine starts executing the rules with the defined rule flow group. When there are no more active rules with the rule flow group, the execution continues to the next element. During the rule flow group execution, new activations belonging to the active rule flow group can be added to the agenda because these acativations are changed by other rules.

Script task

A script task represents a script to be executed during the process execution.

bpmn script task

The associated script can access process variables and global variables. Review the following list before using a script task:

  • Avoid low-level implementation details in the process. A script task can be used to manipulate variables, but consider using a service task when modelling more complex operations.
  • Ensure that the script is executed immediately, otherwise use an asynchronous service task.
  • Avoid contacting external services through a script task. Use a service task to model communication with an external service.
  • Ensure scripts do not throw exceptions. Runtime exceptions should be caught and managed, for example, inside the script or transformed into signals or errors that can then be handled inside the process.

When a script task is reached during execution, the script is executed and the outgoing flow is taken.

User task

User tasks are tasks in the process workflow that cannot be performed automatically by the system and therefore require the intervention of a human user, the actor.

bpmn user task

On execution, the User task element is instantiated as a task that appears in the list of tasks of one or more actors. If a User task element defines the Groups attribute, it is displayed in task lists of all users that are members of the group. Any user who is a member of the group can claim the task.

After it is claimed, the task disappears from the task list of the other users.

User tasks are implemented as domain-specific tasks and serve as a base for custom tasks.