How to customize the work object history or attachment display

Summary

The default presentation of work object history and work object attachments is easier to customize in V.5.5.

For example, you can present the history on a harness form rather than in a separate window, or make the attachments display appear in a flow action. By overriding a standard list view rule, you can control which rows and columns appear, and these may vary by work type or other criteria.

In V5.5+, most of the standard user interface rules that display the work object history are auto-generated. This means that you can more easily customize the display contents and presentation to maximize their value to your application user community.

Suggested Approach

As a work object progresses through a flow, Process Commander creates history records to support the audit trail display. A specific concrete class for each work pool, derived from the History- base class, contains these records.

If your application includes multiple work types, the history display can show different columns (or select different rows) based on the characteristics of each type.

The example below involves customizing the location and contents of the audit trail display. To tailor the attachment display, override and modify the standard list view Link-Attachment.AttachmentList.ALL. The steps are generally similar.

A custom history display

In the following example, a portion of the audit trail appears on the Confirm work object form, highlighting those steps performed by the current operator (John Galt) during the current month and previous month.

The display identifies the flow action used. Since most work objects in this application are resolved in a few hours, not days, only the time appears. Rows are sorted with the most recent items at the top.

Procedure

Step 1: Override the standard list view rule

Copy the standard list view rule History-.HistoryListView.ALL into an application RuleSet version, changing the Applies To class to History-ZZZZZ, where ZZZZZ is a class group or work type in your application.

Step 2: Tailor your list view rule

Tailor the copied list view rule to meet application needs. In this example,on the Display Fields tab, a row was added to include the History-.pyFlowAction property value.

On the Contenttab, the criteria restricted the display to show only history steps created since yesterday, and to reverse the default sort order.

On the Format tab, the existing highlight style listTableRowShadedStyle was applied only to rows where the performer (.pyPerformer) was someone other than the current user (.pyUserName). This allows the current user to quickly review her own contributions.

Two when rules History-MyCo-Emerald.PerformerIsMe and History-MyCo-Emerald.PerformerIsNotMe determine whether highlighting occurs for a row.

Step 3: Embed the list view rule in a section

Create a section rule in the Applies To class of the class group or work type. Delete all but a single (freeform) cell.

Drag and drop the ListView control (in the Advanced group) to the cell. Open and complete the Cell Properties panel. (The Property field on this panel is not significant.)

Click the magnifying glass icon next to the Display As field on the Cell Properties panel to enter parameters for the ListView control. (Consult the help system for details on these parameters.)

Step 4. Include the section within a harness rule

In this example, the section appears as part of the Confirm work object form.

Step 5. Test

Test the harness rule in the application flows.

Other possible history changes

Your history report can use the pyHistoryType property to highlight transfers, or completed connector flow actions.

To include a value in the history that's in the work object but not in any History- property, you can use a Declare Trigger rule to copy a value (for example, the work object status Work-.pyStatusWork) to a History-ZZZZZ property.

Note that, as initially installed, the PegaRULES database table pc_history_work, which holds work object history, has only a few properties exposed as columns. As this table may grow to contain millions of rows, consider exposing all the properties you reference in the list view report, for best performance.

Have a question? Get answers now.

About Pegasystems

Pegasystems is the leader in cloud software for customer engagement and operational excellence. If you’ve driven a car, used a credit card, called a company for service, opened an account, flown on a plane, submitted a claim, or performed countless other everyday tasks, chances are you’ve interacted with Pega. For the past 30 years, our technology – CRM, digital process automation, robotics, AI, and more – has empowered the world’s leading companies to achieve breakthrough results.