Skip to main content

Business rule tasks

A business rule task is used to model the evaluation of a business rule; for example, a decision modeled in Decision Model and Notation (DMN).

task

Business rule tasks behave exactly like service tasks. Both task types are based on jobs and job workers.

The differences between these task types are the visual representation (i.e. the task marker) and the semantics for the model.

When a process instance enters a business rule task, it creates a corresponding job and waits for its completion. A job worker should request jobs of this job type and process them. When the job is completed, the process instance continues.

note

Jobs for business rule tasks are not processed by Zeebe itself. To process them, you must provide a job worker.

Defining a task​

A business rule task must define a job type the same way as a service task does. This specifies the type of job workers should subscribe to (e.g. DMN).

Use task headers to pass static parameters to the job worker (e.g. the key of the decision to evaluate).

Define variable mappings the same way as a service task does to transform the variables passed to the job worker, or to customize how the variables of the job merge.

Additional resources​

Community Extension

Take a look at the Zeebe DMN Worker. This is a community extension providing a job worker to evaluate DMN decisions. You can run it, or use it as a blueprint for your own job worker.

XML representation​

A business rule task with a custom header:

<bpmn:businessRuleTask id="calculate-risk" name="Calculate risk">
<bpmn:extensionElements>
<zeebe:taskDefinition type="DMN" />
<zeebe:taskHeaders>
<zeebe:header key="decisionRef" value="risk" />
</zeebe:taskHeaders>
</bpmn:extensionElements>
</bpmn:businessRuleTask>

References​