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 Send confirmation email service task uses 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
- Define the following activity-level data fields on the
Data Fields tab of the
Send confirmation email service task.
- On the
Scripts tab, define the following
Initiate Script to assign the values defined in the
Customer object to these data fields.
- On the
General tab, enter the field names as shown below.
At runtime, the following actions occur:
- the email message is sent to the email address defined in the emailId attribute of Customer.
- the email message contains the title and name defined by those Customer attributes.