Scenario: A company wants to send an email announcing a CEO change. This email should go to every person related to the company in any way. The company wants to send the email to old customers, current employees, retired employees, prospective customers, and other business people. To do this, a workflow process must collect and consolidate all the email addresses from the company database, and send an email to each.
Process: This process is built in an auto start Workflow-type project.
The following screen shot shows the process:
A series of custom database integration components retrieve all email addresses. Each component returns an array of email address of the data type UserEmailAddress. Each array of email addresses is deposited in the Add Items to Collection component.
The following screen shot shows the Add Items To Collection editor:
Here we see that the data type for this collection is set to UserEmailAddress (the same data type as the custom components). The Array Variable Name box is the name of the array variable that the Add Items to Collection component outputs. This field could also be called Collection Name because the array variable this component outputs is its collection. You can set this variable name however you want.
The "Items To Add" field contains the items that make up this collection. In this case the collection contains four arrays of email addresses: AllBusinessPartnerEmailAddresses, AllCustomerEmailAddresses, AllBusinessPartnerEmailAddresses, and AllFormerEmployeeEmailAddresses.
These four array variables come from the database integration components.
Next, a For Each Element in Collection component hands email addresses one at a time to the Send Email component. This is necessary because the Send Email component can only send one email at a time. When the For Each Element in Collection component exhausts the list of email addresses, it exits through the "finished" path and the process ends.
Other components in this example are as follows:
These components are custom components created with the Integration Engine.
For more information on the Integration Engine, see the Workflow Solution Administrator's Guide.