Version:

Exercise: Add the Selections for the Food Bank Inventory Business Processes

In this exercise, we will create two ad-hoc queries to create two selections to use as options for the Selection parameter.

Data processing for a business process occurs within a .NET CLR class that exists within an assembly that is deployed on the Infinity web server. This code runs within the web services layer. Within this CLR class file, the parameter set values are retrieved and the processing on the data begins in earnest. How the processing occurs is up to you and the output data format is completely open. For more information, see Processing the Data and Business Process Logic.

Selections can be used as parameters to restrict the number or rows processed.

Often business processes require a reference to what's a known as a selection, which is a set of record IDs for a particular record type. Within the food bank inventory business process, the IDSETREGISTERID field points to a system table named IDSETREGISTER. Each row in the IDSETREGISTER table corresponds to a view or table-valued function that returns a list of Primary Key ID values of a particular record type (database table), such as Constituent or Revenue. Users can create selections with Blackbaud's query tool. First, they create an ad-hoc query or smart query, and then they save the query results as a selection. Selection can also be created by other processes. The IDSETREGISTER table is primarily populated through the saving of a selection from the query tool. A selection contains the IDs of the records to be used as input into and processed by a business process in order to restrict the number of rows processed.

Note: Users can create selections with Blackbaud's query tool. A selection can be an input parameter into a business process instance. A selection is a list of record IDs used within the business process .NET code to restrict the number of rows processed. Restriction of the rows typically occurs within the SQL statement in the .NET code with either a JOIN or WHERE clause.

For more information, see Business Process Overview.

Step 1 -  Configure the "All Food Banks (Static)" ad-hoc query and the Static Selection for the selection parameter.

Before we can create the code for the business process, we must create some selections in Blackbaud CRM.

First, let's configure a static selection that contains at least one food bank organization. The number of rows will be a static snapshot of all the rows in the database. The selection will narrow the number of food bank organizations processed by the business process.

Step 2 -  Create a SQLFunctionSpec to generate a dynamic selection.

Selections can be created using queries as in the previous step, but you can also create a built-in selection by defining a SQLFunctionSpec. The SQLFunctionSpec defines a table-valued user-defined function. A child CreateSelection element within the SQLFunctionSpec element indicates that the function should be registered within the IDSETREGISTER table when the spec is loaded. The function defined within the SQLFunctionSpec element must return a single column named or aliased as ID.

Step 3 -  Configure the "Ecumenical Food Banks" ad-hoc query and a selection.

Let's configure a third ad-hoc query and associated selection that narrows the food banks to those of a specific food bank type such as "Ecumenical." This step is similar to step 2 above.