Select your user interface:

Exercise: Build the Status Page

A business process instance status page, also known as the "status page," is primarily used to view the recent and historical statuses for a business process and its associated parameter set. After a business process is started manually, the task or action typically redirects the user to the status page. A user should also have the ability to start a new instance of the business process with the chosen parameter set on the status page.

Let's build a status page that fulfills the use case diagram and the requirements described in Business Process Instance Status Page. To start, we will load some custom features from the lab answers source code project. These custom features provide the basis for fulfilling all but one of the green use case ovals above.

Here is a link to the Food Bank Source Code.

Step 1 -  Load custom features.

In future steps, we will utilize these features along with out-of-the-box features that ship with Blackbaud CRM to build a status page.

Step 2 -  Configure a new page and set the context, expression view form, caption, and summary section.

Let's build a new page for our status page. Our page requires a context value of "Inventory Process Parameter." A page that is configured with a context record type requires that an ID value of that same record type is passed to the page when the page opens. After the context is passed to the page, this value is stored within a property on the page named PageContext. By configuring the page in Design Mode, an administrator can use the value for the PageContext property to pass the context value to other features and actions referenced on the page. For more information on pages, see Pages.

As a reference, we will review the metadata for a completed example of the status page that we will ultimately build with this exercise. Below, we see the context record type is equal to "Inventory Process Parameter," which is a reference to the primary key value of the custom USR_INVENTORYPROCESS table that holds the parameter sets for our custom business process. For more information on the entity relationship diagram supporting business processes, see Tables.

Figure: Metadata displays the context record type of the completed status page

Within the page, the value for PageContext, which is the primary key value of the custom USR_INVENTORYPROCESS table that holds the parameter sets for our custom business process, is passed to a myriad of features referenced within the page. A few examples are the summary view data form, View Data Form within the Recent Status tab, and the expression data form on the page.

Let's begin to configure a new page:

Step 3 -  Test the page.

Step 4 -  Configure 3 tabs on the page.

Our new page will contain three tabsRecent Status, History, and Job Schedules.

Recent Status Tab

History Tab

Job Schedules Tab

Configure the Add, Edit, and Delete Actions for the Job Schedules Section

This tab will contain one section to display the "Business Process Job Schedule List," and the section includes actions to add, edit, and delete job schedules.

Add Job Schedules Action

Edit Action

Delete Action

Step 5 -  Configure the Tasks action group with new actions on the page. Configure the Edit process action.

You will now add actions to the Tasks action group on the far left side of your new page.

  1. Edit process

  2. Generate WSF

  3. Create job schedule

  4. Create task

  5. Delete process

  6. Start process

Step 6 -  Configure the Generate WSF action.

The Generate WSF action creates a Windows Scripting File that you can run once or schedule using Windows Task Scheduler. For more information. see Generate WSF Action.

Step 7 -  Configure the Create job schedule action.

Click the Create job schedule action to open the Business Process Job Add Form, which is a data form that ships with Blackbaud CRM.

Figure: Create a SQL Server Agent Job for the business process with a given parameter set

When the data form is saved, it creates a SQL Server Agent job using an ActiveX script to run the business process with a specific parameter set.  For more information, see Create Job Schedule Action.

Step 8 -  Configure the Create task action.

Note: Web Shell Alert. The Create task action only surfaces in the ClickOnce user interface. It is not available in Web Shell.

The Create task action opens the Run Business Process Task Add Form that ships with Blackbaud CRM. This data form looks strikingly similar to a property sheet for a task. At run time, this data form allows the user to create a task to run the business process with the current parameter set. For more information on this action, see Create Task Action.

Figure: Click the Create task action to open the Run Business Process Task Add form

Step 9 -  Configure the Delete process action.

The Delete process action in the Tasks action group on our status page calls upon a custom record operation named "Inventory Process Business: Delete" to delete the parameter set for the business process. The record operation calls upon a stored procedure to delete a row from the custom USR_INVENTORYPROCESS table that stores parameter data for a specific business process. For more information, see Business Process Parameter Set Table

Figure: The Delete process action

Step 10 -  Configure the Start process action.

Create a new action to start our business process. End users can click the Start process action within the Tasks action group to start the business process with the specified parameter set.

Figure: The Start process action

In this step, we will start the business process and then navigate back to the same status page to view the results. This step assumes that the Business Process Spec was completed and loaded into the Infinity catalog/database. This step also assumes the CLR code that forms the logic for the business process was compiled within the catalog assembly and the assembly was deployed to the Infinity web server. We will create an action button to start the business process given a selected parameter set. After the business process starts, we will navigate to the page via the StatusPage property within the action

Step 11 -  Inspect the output format table.

Output tables may be created as a result of a business process. The BusinessProcessOutput table contains data describing the output of a particular business process run. The BusinessProcessOutput.TableName field refers to an output table for a given instance of a business process. The BusinessProcessOutput.TableKey field is the key by which this table is referenced internally. For more information, see BusinessProcessOutput.

Open SQL Server Management Studio and query the BusinessProcessOutput table within the appropriate Infinity database. Use the Transact-SQL SELECT statement below to determine the name of the generated business process output table.

Tip: Be sure to use your BusinessProcessSpec's ID attribute value within the WHERE clause.

SELECT TOP 1000 BPO.[ID]
      ,BPO.[BUSINESSPROCESSSTATUSID]
      ,BPO.[TABLENAME]
      ,BPO.[TABLEKEY]
      ,BPO.[ADDEDBYID]
      ,BPO.[CHANGEDBYID]
      ,BPO.[DATEADDED]
      ,BPO.[DATECHANGED]
      ,BPO.[TS]
      ,BPO.[TSLONG]
      ,BPO.[DOWNLOADPARAMETERS]
      ,BPO.[COLUMNMETADATA]
  FROM [dbo].[BUSINESSPROCESSOUTPUT]BPO
  INNER JOIN BUSINESSPROCESSSTATUS BPS ON BPO.BUSINESSPROCESSSTATUSID = BPS.ID
  INNER JOIN BUSINESSPROCESSCATALOG BPC ON BPS.BUSINESSPROCESSCATALOGID = BPC.ID
  WHERE BPC.ID = 'YOUR BUSINESS PROCESS ID GUID GOES HERE'

For example, the query below results in the following results: 

In the sample query results above, the TableName column provides the name of the output table generated from our business process. Querying this table provides the results of the business process run given the selected parameter set. See below. Your results will vary depending on the food bank transaction within the database and the parameters chosen for the given parameter set.