Exercise: Bring the Input Parameters into the Workflow

The first thing we need to do in our workflow is obtain the Constituent ID, Revenue ID, Amount, and Amount Threshold values that are the main parameters to our workflow. In our Workflow Start Add Data Form named Major Giving Workflow Instance Add Form (Custom), we capture these four values as form fields and then kick off the workflow. All form data that is captured by the Workflow Start Add Data Form is associated with the workflow and available to use within the workflow logic. In fact, this form data is delivered to the workflow as part of the StartWorkflow activity that was included with the workflow template that is already in our sample.

Tip: The form fields within Workflow Start Add Data Form are delivered to the workflow as part of the StartWorkflow activity.

The StartWorkflow activity has an OutArgument named startInputDataFormItemXml that is populated with the form data from the add form that kicks off the workflow.

The value of this string variable will be the standard DataFormItem serialized XML format that is used throughout the AppFx web service API as the payload to carry form field values. (When you click Save on the AddForm under the hood, the form packages up the values into a DataFormItem, serializes it, and ships it up to the web server. This is the standard implementation of all Infinity Forms).

You are free to do what you want with this XML in your workflow. We want to obtain the values for the form fields, and that is exactly what we want to do in this case to get the values for Constituent ID, Revenue ID, Amount, and Amount Threshold.

There is an activity that is part of the Blackbaud activity library that is designed to obtain the value of a field in a DataFormItem xml string named GetDataFormItemFieldValue.

Instructions

Step 1 -  Create a workflow variable for the data form XML.

We need to create a variable in the workflow named "startInputXml" that is assigned to the startInputDataFormItemXml OutArgument:

Step 2 -  Assign the startInputXml variable to the startInputDataFormItemXml OutArgument.

Step 3 -  Create Workflow Variables for each of the four form fields

Step 4 -  Create a Sequence Activity named "Initialize Workflow."

A Sequence Activity runs a set of child activities according to a single defined order. The Sequence Activity is a Composite Activity, meaning the Sequence Activity can contain other activities. A Composite Activity is responsible for the execution of its child activities.

Step 5 -  Place four GetDataFormItemFieldValue activities within the Sequence Activity.

We want to grab the values from our form fields (Constituent ID, Revenue ID, Amount, and Amount Threshold) and place each value into the appropriate variable.

There is an activity that is part of the Blackbaud activity library that is designed to obtain the value of a field in a DataFormItem XML string named GetDataFormItemFieldValue.

Step 6 -  Drag the existing LogMessage Activity inside the Initialize Workflow Sequence Activity.