Skip to main content

Parameterized Tasks

The includeParameters enables Tasks to be configured with a Parameter object.

The option requires you to define a target Parameter DataElement.

The StateTask has a params field. When a Task with the includeParameters option runs, an instance is fetched with the name or, if defined, functional key equal to the value of this params field.

This instance is then passed to the Task implementation.

Usage

You can use this if you have a Task that can be configured with certain properties. It allows you to configure these at runtime.

E.g. configure a template and from-address for a mail-sender Task.

Option
includeParameters TaskElement

Adds the Details projection of a ‘parameter’ dataElement as additional argument for the task.

Before performing a task, the task bean will attempt to fetch an instance of the target type based on the params value in the StateTask. This object will then be added to the task with a setParameter() method.

<options>
<includeParameters>invoices::InvoiceSenderConfiguration</includeParameters>
</options>