Select your user interface:

Use a QueryViewSpec as a Parameter for Output Formatting

A QueryViewSpec is traditionally used to provide tables and fields to select within the Blackbaud CRM ad-hoc query tool. As an example, within the food bank source code, the FoodBank.Query.xml file contains a QueryViewSpec that leverages the custom USR_FOODBANK and USR_FOODBANKTYPECODE tables. The FoodBank.Query.xml file can be found within the food bank source code's catalog project. The USR_FOODBANK table extends the CONSTITUENT table in a one-to-one relationship providing additional columns of data for a food bank organization. When the QueryViewSpec is loaded into the Infinity catalog (database), we can see the result by creating an ad-hoc query that is based on the "Constituents" source view. Below we can see the additional food bank columns as defined by the custom QueryViewSpec

Figure: The traditional use of a QueryViewSpec is to support ad-hoc query.

But, how can a software developer use a QueryViewSpec in conjunction with a business process? While not required, a best practice is to use a QueryViewSpec to define the output format of a business process. Typically, before starting an instance, an end user may select a reference to a specific QueryViewSpec as one of the input parameters into a process. Different parameter sets can contain references to different QueryViewSpecs, which in turn affect how the data is processed and which columns appear in the final output. In short, a QueryViewSpec can be used to drive the columns of data created by a business process.

Note: The best practice to define the output columns is to utilize a reference to an Output Format QueryViewSpec as a parameter value into the business process instance. The QueryViewSpec defines a database view

After a parameter set is selected and a business process instance is started, the Infinity platform calls upon .NET code to process a set of records. Within the business process Visual Basic code, a base set of records may be combined with the records and columns defined by the QueryViewSpec. If necessary, the Transact-SQL logic within the QueryViewSpec influences the processing of data within the business process. The output fields defined within the QueryFiewSpec determine the columns of data created as the output from the business process.

Below is an example of a QueryViewSpec that is used to drive the output format for the food bank inventory business process that we will build. Specific tags within the QueryViewSpec help relate the query to a specific business process and the processing that occurs therein:

The figure below displays the same QueryViewSpec shown above along with the BusinessProcessSpec spec. The highlighted areas illustrate the relationships between the two specs.