Exercise: Use a View Form to Retrieve Data in a Workflow

The purpose of the exercise is to continue practicing bringing Infinity features into the workflow and assigning the result of a view data form into a strongly typed variable. We will then leverage this variable within our workflow using an additional FlowDecision Activity.

At this point within our workflow, we know when we have a large vs. a small gift. If it's a large gift, the workflow automatically marks the revenue transaction as "Do Not Acknowledge." Our next step is to determine whether or not the constituent who provided the payment is a major giving prospect. If the donor is already a major giving prospect, we will simply exit the workflow. If the donor is not already a major giving prospect, then will continue the workflow.

For more information, see Add Features to an Infinity System Role

Instructions

Step 1 -  Locate the Feature using “Go To”

The Constituent page's expression view data form contains a wealth of information pertaining to a constituent including true/false values for each of the built in constituencies such as donor, major giving prospect, board member, volunteer, etc.  

Step 2 -  Permission the feature.

Step 3 -  Bring the feature into the development environment.

Within Visual Studio, select Tools\Add System Role Activities to add the activity to the toolbox. 

Step 4 -  Place the feature on to the Workflow Designer (MajorGiving.xamlx).

Step 5 -  Create a variable to hold the value of the data form's Result outArgument.

In the next step we will create a variable to hold the values retrieved by the view data form. To get the appropriate variable type, we can view the API tab on the metadata page: 

As you can see from the figure above, the ConstituentPageExpressionViewFormData data class can be found within the Blackbaud.AppFx.Constituent.Catalog.WebApiClient.ViewForms.Constituent namespace within the Blackbaud.AppFx.Constituent.Catalog.WebApiClient.dll client-side web API assembly.

Step 6 -  Provide the properties for the ConstituentPageExpressionViewFormData activity.

Property Name

Value

DisplayName

ConstituentPageExpressionViewFormLoad

RecordId

inputformfieldConstituentID.ToString

Result

resultConstituentPageExpressionViewFormData

Step 7 -  Review the references to the Workflow Assemblies.

View the properties for the Visual Studio 2010 project. Select the References tab

When we added the Constituent Page Expression View Form activity to Visual Studio, behind the scenes the following references were set to our project:

The workflow activity, ConstituentPageExpressionViewFormLoad, is defined within the Blackbaud.AppFx.Constituent.Catalog.Activities assembly.

The class that defines the data returned by the activity, ConstituentPageExpressionViewFormData, is defined within the Blackbaud.AppFx.Constituent.Catalog.WebApiClient.dll client-side web API assembly.

These assemblies should ultimately be deployed to the Blackbaud workflow service application on the Blackbaud workflow server such as c:\inetpub\wwwroot\bbwf\bin\.

Step 8 -  Connect the Sequence Activity to the flowchart.

Connect the new sequence activity to the Do Not Acknowledge business activity. Your flowchart should now look like this:

Step 9 -  Add a new FlowDecision activity

Now that we have our constituent data from the expression view form loaded into the variable: resultConstituentPageExpressionViewFormData, we can leverage the variable within the condition of a new FlowDecision activity. The resultConstituentPageExpressionViewFormData variable contains the values for the form fields on the expression view data form including Boolean values for each of the system defined constituencies, such as major giving prospect.

Step 10 -  Add activities for each outcome of the FlowDecision.

Our next order of business is to add two business activities to the flowchart, one for each of the possible outcomes of the FlowDecision. We will connect the true outcome to a new BusinessActivity that contains a Sequence Activity that in turn contains a new LogMessage Activity. The LogMessage Activity logs the fact that the donor is already a prospect to the database. Next, we connect the false outcome to a BusinessActivity which eventually sends an approval task to the Director of Special Giving. The business activity that sends an approval task is a little more involved, so we will save the implementation details for a later exercise. In the meantime, the false outcome business activity just contains a log message stating that the donor is not a major giving prospect.

Your flowchart should look similar to this:

Step 11 -   Add Sequence and LogMessage activities for the "true" business activity.

Your business activity should look similar to this:

Step 12 -  Repeat the previous step for the "false" business activity.

Your business activity should look similar to this: