Example of Setting up Dynamic Data Inputs to an Email Message

A project contains a process that uses an email service task to send a delivery confirmation email to a customer.

The process is triggered by an external application that sends in the customer’s email address, name and title.

The Start Event collects this data via a formal parameter, customer, which is defined as an external reference to a business object model that defines a Customer class.

The Input to Process tab of the Start Event defines the mapping of the received data to the customer formal parameter.

The Send confirmation email service task will use the email address, name and title to dynamically build the email message. However, the service task cannot use the customer formal parameter to obtain this data.

Instead, to access the Customer attributes name, title and emailId on the service task, you must perform the following steps:

Procedure

  1. Define the following activity-level data fields on the Data Fields tab of the Send confirmation email service task.
  2. On the Scripts tab, define the following Initiate Script to assign the values defined in the Customer object to these data fields.
  3. On the General tab, enter the field names as shown below.


Result

At runtime, the email message:

  • will be sent to the email address defined in the emailId attribute of Customer.
  • will contain the title and name defined by those Customer attributes.