Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 49

Pega 6.

2 features

Data Transforms
What is a data transform?

Data transformation typically involves both mapping data from a source to a target, and performing any
conversions or other transformations on that data that might be required to achieve the intended
mapped results.

Generally speaking, a data transform defines how to take source data values — data that is in one
format — and transform them into data of another format (the "destination" or "target"). In a Process
Commander application, data transforms provide you with a way to easily copy, map, and transform
clipboard data (pages and properties on those pages).

Some examples of situations in which to use a data transform rule are:

 Copying a clipboard page to make a new page.

 Mapping properties (and their values) on one page to another, existing page.

 Mapping properties (and their values) on one page to a new page.

 On a given clipboard page, defining one or more initial properties on that page and setting their
values. A data transform can set many property values on a page in one processing step.

 Appending pages from one Page List property to another.

Even though an activity rule could be used to set many property values on a page, using a data
transform rule speeds development and is easier to maintain, because the data transform rule form and
the data transform actions are easier to understand than the activity rule form and activity methods,
especially when the activity includes custom Java code.

Data transform rules are instances of the Rule-Obj-Model class. Prior to Version 6.2, these rules were
known as model rules, and only involved setting property values. Starting with Version 6.2, these rules
provide more powerful actions than in V5X-V6.1

A data transform is presented as a structured sequence of actions. When the system invokes the data
transform rule, it invokes each action in turn, following the sequence defined in the data transform's
rule form.
The Data Transform rule form

The most important tab is the Definition tab. The actions to be taken are presented as a sequence of
rows in a tree grid. Except for the conditional types of actions (such as When, For Each Page In, and
similar actions) and transitional actions (such as Exit For Each and similar actions), the system invokes
each row in sequence, starting with the first row.

In general, each row provides for:

Column Description
Action An action to be taken.
Target A target, if the action requires a target.
A relation, if the action requires a relation to be specified. This relation is a relationship
Relation
between the specified target and source.
Source A source, if the action requires a source.

Some actions do not involve sources, targets, or relationships. The form makes an item unavailable for
selection if it cannot be used in the specific context of the particular action in that row, or in the row's
position in the array with respect to its parent rows.

Best practice: In general, aim to limit a data transform to fewer than 25 steps. If more actions are
needed, create a separate data transform rule and use the Apply Data Transform action in the first data
transform rule to invoke the second data transform, that will complete the subsequent actions.

Rows as siblings and children

In the Definition tab, you can set the logical structure of actions by right-clicking an existing row and
selecting to add a sibling (either above or below the existing row) or add a child row (for actions that can
have children).

This tree-like structure is automatically applied when you use conditional actions. The array on the
Definition tab reflects the conditionalized sequence using an expanding-collapsing tree structure.
For example, the following image shows a When - Otherwise conditional sequence. In this example, if a
property value indicates that the customer's Billing Address is the same as the Shipping Address, then
the BillingInformation page is updated by copying values from the ShippingInformation page. Otherwise,
the BillingInformation page's properties are set to blank.

When you specify an action that requires certain subsequent actions, the system automatically adds
rows for those required children actions.

Parameters tab

Define variables that input data to, or return data from, a data transform. Parameter names and values
are held on a special page — the parameter page — that is not visible on the Clipboard tool display.

In fields on the Definition tab, use the notation param.ParamName to reference a parameter value..

Pages & Classes tab

To use page names in fields on the Definition tab, those pages must be specified on the Pages & Classes
tab.

At runtime, the system uses this information to find properties on the clipboard that are referenced on
the Definition tab using the notation .Propertyname. The page name for the property is identified
according to the specific context at runtime (depending on things such as the particular data transform
action involved, a preceding action that set the page name, etc). The leading period (or dot) is required.

The system also uses information on this tab to interpret property references of the form
Pagename.Propertyname used in various fields on the Definition tab.
Example data transform

The scenario for this example is an order management application. At a point in the process, users add
products and quantities of those products to their shopping cart using an Add to Cart button. The
application designer has designed the following user experience for the application's users:

1. When the user selects to add a particular product to the shopping cart, the system should check
to see if the cart already contains that product item.

2. If the item is found in the shopping cart, the system should notify the user and present the user
with fields to update the quantities of that item in the cart.

3. If the item is not found in the shopping cart, the system should add the product to the cart, and
ask the user for the quantity to add.

The designer has a Page property named ItemToAdd that holds data about the product item that the
user just selected and clicked Add to Cart in the user form. There is also a Page List property named
Items that is the set of all product items in the user's shopping cart. An embedded property (Found) on
the ItemToAdd page is a flag that indicates whether the item is already in the cart or not.

In the data transform shown below:

 If the system finds the product already in the cart (pyWorkPage.ItemToAdd.Found=="true"), it


updates the Quantity property on the page in Items for that specific product with the new
quantity.

 Otherwise, the system adds a new page to the Items Page List for the selected product, and
maps the values of the embedded properties for the selected product to properties on that new
page.
AddProductToCart data transform:

The When-branch of actions when selected product is already in the shopping cart:

The Otherwise-branch of actions when selected product is not already in the shopping cart:
The Pages & Classes tab of this data transform specifies the pyWorkPage name and its class, so that the
system can locate the ItemToAdd page and the other properties from the work item that exist on the
pyWorkPage.

The Remove action at the end of this data transform removes the ItemToAdd page from the clipboard
after the data has been copied to the Items Page List for the shopping cart contents.

Actions you can use in a data transform

Actions are the individual operations that are specified in each row on the Definition tab of a data
transform rule. The system invokes the actions at runtime. This section provides usage information on
the available actions. Consult the Developer Help in your system for additional details.

For the Set action and many others, the Target field identifies a property or page reference, and the
Source column provides an expression that results in a value or values.

Append to:

You typically use this action to copy a page to the target, or to copy all of the embedded pages in a
source Page List property to a target Page List property. The source and target must be of the same or
compatible classes. (A compatible class is one that is higher up in the class hierarchy of the class's
inheritance path. For example, class A-B is a compatible class of class A-B-C. For the Append to action,
you can have a page of class A-B-C as the source and a page of class A-B as the target.)
Append and Map to:

Use this action to add a new page to the target Page List property and prepare for the subsequent child
actions to set or map properties on that page. Unlike the Append to action, the target and source in the
Append and Map to action can belong to different classes, and do not have to be in the same
inheritance path.

When the system invokes the Append and Map to action, it creates a new page in the target Page List
property, and sets the context to that page for the following children actions. You then use the children
actions to create the properties on the page.

To map properties from another existing page (source) to the newly created page, select either an
existing page (for a Page source) or each page in (for a Page List or Page Group source) from the
Relation list.

For sources that are Page List or Page Group properties, with the Relation set to each page in, you can
choose which pages from the source to conditionally copy pages from that source to the target. For
example, when you want to map data from an AllCustomers source Page List property only for
customers that are "preferred" customers, you can set a condition to use only those pages from
AllCustomers where a Preferred property is set to true.

Apply Data Transform:

Use this action to apply actions defined in another (different) data transform to a clipboard page. The
Apply Data Transform action applies the other data transform to whatever page is identified by the
current context. The current context is set by a preceding action (such as an Update Page or For Each
Page In).

Click Find icon to specify whether to pass the current parameter page or to provide values for input
parameters for the specified data transform.

Comment:

Use this action to provide comments within the sequence. For example, to explain the goal of a
particular branch of steps.

For Each Page In, Exit For Each:

Use the For Each Page In action to iteratively apply actions specified in the subsequent rows to all of the
pages in the specified target. The target must be a Page List or a Page Group mode property.
Use the Exit For Each action to stop the iterations of the For Each Page In action.

In the following example, given the Shipments Page List property, the For Each Page In action starts a
set of actions to set the GoalTime and DeadlineTime properties for each page in Shipments. In this
example, the values that are set on each page depend on the value of the ShippingSpeed property,
determined by the When actions that are children to the For Each Page In action.

Exit Data Transform:

Use this action to exit this data transform at this row. At runtime, the system processes the rows on this
tab sequentially. You can use this action to end invocation of the actions in the data transform before
reaching the rows following this action; for example, to conditionally skip the remaining actions. The
actions in rows following the Exit Data Transform action are not executed..

When, Otherwise, Otherwise When:

Use the When, Otherwise, and Otherwise When actions to conditionalize data transform actions, so
that the system invokes the actions only when the specified conditions are true.

For example, an ordering process might have an input form where customers can select a checkbox to
indicate whether their billing address is the same as their shipping address. Use a When action to tell
the system to perform a set of actions (children rows of the When row) when that checkbox is selected
(BillAddressSameAsShipping property is true). By using an Otherwise action after the When action, you
can specify alternative actions to apply if the checkbox is not selected.
Remove:

Deletes the target and any associated values from the clipboard. The target can be a value mode
property (Single Value, Value List, or Value Group), a page mode property (Page, Page List, or Page
Group), or a declarative page.

Set:

Sets the target to equal the source. You can set Single Value properties, top-level pages, embedded
pages, page lists, and page groups. Set is typically used to initialize properties. If a target page is
specified that does not yet exist on the clipboard, the Set action creates the pages.
Update Page:

Sets the page context for the subsequent (children) actions. Use when you want to set properties on a
page that is different from the data transform's primary page, and you want to:

 Use source values from a page that is different from the data transform rule's primary page
 Avoid entering the target page name each time in the children Set actions

For example, the following data transforms are equivalent:

and

If the target page does not already exist on the clipboard, the system creates the page.

You can set the page context for the target only, or for both the target and source. If the source page is
different than the primary page, select the with values from choice from the Relation drop-down list,
and specify the source page.
Report Definition
Report definition rules provide power, flexibility, and ease-of-use for report designers and report users,
these rules are intuitive, provide an all-in-one-page design interface, intelligent defaulting and pre-
defined reusable report elements.

Use a report definition rule to define a report or a personal version of a report. This rule generates
HTML that displays selected data in many types of formats, and allows a wide variety of user
interactions with the displayed results.

Because the report definition rule is a unified type for all reports, business users can more easily create
and organize their own reports.

Report Definition:

Report definition rules are similar to two other types of report rules: list view and summary view. Report
definition rules, introduced in V6.1, provide much of the functionality of these earlier rule types, plus
new features, and are easier to define than the list view and summary view rules.

Summarized reports similar to Summary View rules

These reports contain two types of columns. At least one of the columns in the report must be a
summarized column. A summarized column contains data that uses one of the following built-in
functions:
COUNT(), SUM(), AVG(), MIN(), and MAX().

All non-summarized columns on the report are considered "group by" columns. The summarized data is
grouped by, or broken down by, display counts of class instances (or record counts) or summarized
values based on numeric properties.

List-type Reports similar to List View rules

These types of reports display unsummarized or detailed data for individual work objects or class
instances.

How to Complete the Rule form to create a new Report Definition

Create a new Report Definition rule using the following steps:

1. Use the New dialog box to enter a name for the report that meaningfully describes the purpose
of the report.

2. Complete the Design tab (below) to:


 Define which properties, functions, or expressions are to be included as columns in the report,
and the settings that control how each column appears (heading, width, format, sort order, and
so on.)
You can define these by entering the appropriate values in the fields below, within the Columns
to Include section.
Note: You can only show properties that correspond to exposed database columns
 Define filtering conditions in the Rows to Include section. These define which class instances are
to be included as rows in the report or in summarized data. The Rows to Include section
operates similarly to the criteria section on the List View form.
 Define general settings to control the appearance of the report under General Report Settings.

 Click Include a Chart and then complete the Chart Definition dialog to add and configure a chart
display of the report’s data within the Report Viewer. This can only be done for Summarized
reports.
 At any time while completing this tab, you may click Save & Preview to save the current report
definition and display the results in the Report Viewer.

3. Complete the Data Access tab to define joins to other classes, declarative indices, and/or
reports.
4. Complete the User Interactions tab to control how users can interact with the report within the
Report Viewer, such as:

 Whether users can modify the report, print it, export it to Excel, and so on.

 Whether SmartInfo icons appear on each row of detailed reports, to display additional
information about each row.
5. Complete the Parameters tab to document the name, description, and data type of parameters
used in the Report Definition rule.

6. Enter a Full Description on the History tab which explains the report in more detail.

7. Click ( ) to Save the rule or the Save & Preview button to save and preview the rule in the
Report Viewer.
Tips and Features

 AutoComplete is available when defining properties in the Design tab.

o AutoComplete replaces SmartPrompt in rule form and Report Viewer.

o AutoComplete shows matches on name or label.

o Best Bets are properties used in other reports.

o Matches can include properties in other classes.

 Click Save & Preview at any time to save the rule and run it in the Report Viewer. You can edit
settings from the Design tab in the Report Viewer as well (you do not need to close the Viewer
and return to the Design tab).

How to create a report (V6):

There are two ways to create a report using a report definition rule:

 Create a report using the Report Browser and Report Viewer


 As a developer, create a report definition rule directly

Create a report using the Report Browser and Report Viewer

The Report Browser lets the user quickly create reports, and adapt existing reports, about work types
and other data in the applications identified in the user's access group. A manager can use the Report
Browser without needing a deep understanding Process Commander rules, and without access to the
Designer Studio..

The Report Browser appears in the Manager composite portal provided by Process Commander, and
may appear in other composite portals created by your organization. If you do not have access to a
composite portal containing the Report Browser, add one to your access group:
1. Open the access group associated with your account and select the Settings tab.

2. Locate the Secondary Portal Layouts section and add a composite portal to your list. Process
Commander provides a sample manager composite portal named "Manager". Your
development team may have provided others.

3. Save the access group. You may need to log out and log in again for the changes to take effect.

Once you have access to a manager composite portal, open it by clicking the Run icon ( ) and selecting
Open Portal > Manager. The portal appears in a new window.

Select the Monitor Activity area of the portal to display the Report Browser.

Make sure you have a Personal Reports category. Until you have one or more categories, you cannot
save personal reports. To create a category, click the New Category icon ( ) and, in the form that
appears, provide a name and description for the category. The category in this example is "personal
reports", but you can create as many categories as you like, with whatever names best suit their uses.

For Owner Type select Personal. Click OK to create the category.

Now you are ready to create a new report. Click the New Report icon ( ) to display the Create New
Report form. Select the Data Type for the report from the list of available types:

Complete the rest of the form by providing a name, title, and description for the report. Save the report
in one of the available personal reports categories:
Click OK to create the report. The gadget selects some default properties of the data type you chose, to
provide a basic report you can modify.

To specify the correct data for the report:

With the report displaying in the Report Viewer, click the Edit Columns to Include icon:

The Columns to Include form appears, displaying default data selections, as shown above. You can now
specify data for each column in the report, and how it is to appear. You can add columns or delete
existing columns.

Click OK at any time to see how your changes affect the data the report includes. To save your changes,
click the Save or Save As icons at the top left of the Report Viewer.

Using the Report Viewer to define and evolve simple reports

When you run a Report Definition report from the Report Browser of the Manager portal, results
appear in a separate window called the Report Viewer. You can also access the Report Viewer from the
Report Definition rule form.

The Report Viewer offers many options for manipulating the displayed report, such as Printing it,
Exporting it to Excel, and so on.

The Report Viewer also provides intelligent drill-down and drill-up behavior and offers almost all the
functionality from the Design tab of the Report Definition rule form to re-design the report.
Using the Report Viewer, you can:

 Change the report title.

 Modify filter criteria.

 Change column headings, format, and sorting.

 Change order of columns.

 Add columns.

 Save changes to original report, or save changes as a new report.

The Report Viewer is comprised of several key areas which allow for data and display manipulation.

The sample Report Viewer below displays a report on Purchase Orders by Operator Name, including
Create Date and Time, Work ID and Work status.
Command Bar and Search

At the top of the window is a Command bar. It features several icons that provide basic commands for
manipulating the report.

Using the Command Bar icons

The Command Bar icons include:

 Save: If this is a report that you have created, this command lets you save your changes,
which overwrite and replace the previous report definition rule.
 Save As: This command lets you save this report, with any changes you have made, as a new
Personal report.
 Print: Prints the report.
 Edit Columns to Include: Provides a global view of the design of the report, and lets you
change which columns are included, column order, and all of the column settings listed below.

 Append Column: Lets you add a new column to the report. The new column appears as the
right-most column.
 In the example, the .pyResolvedTime property is appended to the report.
The Resolution TimeStamp column appears at the end of the report, following Work Status.

 Edit Report Title: Lets you change the report title.


 Add or Edit Chart: Lets you add a chart to the report, or modify the design of an existing
chart on the report.
 Export to Excel: Exports the data of the report into an Excel workbook.
 Export to PDF: Exports the formatted report into a PDF document

How to Search in the Report Viewer

The Commander Bar also includes a Search box at the upper right. Search from the Report Viewer allows
for quick searching of the currently open report.

To perform a search:

 Type any text into this box and press Enter or click the Search icon ( ).
Search finds the first occurrence of the text in the body of the report, highlights it, and the
cursor moves to that position in the report.

 Click the Search icon ( ) again without changing the text moves to the next occurrence of the
text within the report, and so on.

Report Header
The report header displays the title of the report, the count of rows displayed in the report, and the
filter conditions that determine which rows are included.
The filter conditions (Filters) are displayed as a hyperlink. Click to open the Rows to Include dialog
(below). This lets you change the conditions that describe which rows of data to include in the report.
This provides the same functionality as the Design tab of the report definition rule form.

Column Heading

At the top of each column is a column heading that describes the information in the column.

Click the column heading to sort the report based on the values in that column.

Click repeatedly on the column heading to change the sorting from ascending ( ), or descending ( )
order.

Settings on the User Interactions tab

It is also possible to set or restrict many of the Report Viewer capabilities from the User Interactions tab
in the Report Definition rule form. Some of the capabilities include: Save, Save As, Print, Edit Columns to
Include, Append Column, Edit Report Title, Add or Edit Chart, Export to Excel, and Export to PDF.

As a developer, create a report definition rule directly.

If you have access to the Designer Studio, you can create a new report definition rule directly. This is a
longer process, but lets the developer create reports for data types in any existing class. Further, the
developer can create class joins to access data from multiple related tables in the database.

In the Rules Explorer, select Reports, right-click on Report Definition, and select New. Complete the
New Rule form, providing the class the report will belong to in the Applies To field and giving the report
a descriptive name in the Report Name field.
When you create a report definition rule using the Report Viewer, the new rule has a default set of
properties so that, if you view the report, you will see data immediately. When you create a report
definition rule using the New Rule form in the Designer Studio, the resulting rule has no default
properties or data access information. You must fill in the information on each tab to make a useful
report.

 Complete the Design tab to:

o Define which properties, functions, or expressions are to appear as columns in the


report, and the settings that control how each column appears (heading, width, format,
sort order, and so on).

o Define filtering conditions that define which class instances are to be included as rows in
the report or in summarized data.

o Define other general settings to control the appearance of the report.

o Optional. Click the Include a Chart button and then complete the Chart Definition dialog
to add and configure a chart display of the report’s data within the Report Viewer. This
can only be done for Summarized reports.

At any time while completing this tab, click the Save & Preview button to save the current report
definition and display the results in the Report Viewer.

 Optional. Complete the User Interactions tab to control how users can interact with the report
within the Report Viewer, such as:

o Whether users can modify the report, print it, export it to Excel, and so on.
o Whether SmartInfo icons appear on each row of detailed reports, to display additional
information about each row.

 Optional. Complete the Data Access tab to:

o Define joins to other classes, declarative indices, and/or reports.

 Optional. Complete the Parameters tab to document the name, description, and data type of
parameters used in the report definition rule.

 Enter a Full Description on the History tab which explains the report in more detail.

Note: After you create and save a report definition rule, it becomes accessible in the Report Browser for
anyone with access to the class to which the rule applies. A manager can select a report a developer has
created, save a copy of it in the Report Viewer, and make further modifications to suit specific needs.

Using the Report Browser to organize and manage reports

The Report Browser in the Manager portal lets you run reports, as well as browse and search for existing
reports available to you. In addition, you can create new reports and share them with other users who
have access to a Manager portal..

The Report Browser also allows you to re-organize reports within categories you define.

Overview

The Report Browser is divided into two sections – the left panel displays a search box for finding reports
based on keywords, their name, title, or description (see red box below - Search for Reports), and report
categories (see green box below). The right panel of the Report Browser at first lists all reports available
to you, and then shows you those reports that match your search or are in the category you select.
Creating New Reports and Categories

How to create a new report:

1. Click the ( ) icon to create a New Report.

2. At the dialog, fill out the relevant information: the type of data included in the report, a name,
title, and description, and the Personal category to assign the report. The name should not have
embedded spaces or special characters. The title will appear in the report header.

3. Click OK to create the report.

How to create a new category:

1. Click the ( ) icon to create a New Category.

2. At the Add/Edit Category dialog, add either a Standard, Shared, or Personal Category,
depending on your privileges. These three types of categories are discussed below.

3. Click OK to create the category (or edit the pre-existing category).

Report Categories — Standard, Shared, and Personal Types

Report are grouped into Categories to simplify finding the report your want. Shortcuts to the same
report can appear under more than one category. Each report category is of one of the following types:

 Standard ( ) — Reports created by application developers for the use of work managers, and
are accessible to all work managers of an application. The categories for Standard reports are
pre-defined.

 Shared ( ) — Reports created to share with other users. They are accessible by the user who
created them and by others with the same access privileges as the users who created them.
They only appear in report search results for these users. The categories for Shared reports are
defined by users.

 Personal ( ) — Reports created by you for your own personal use and are accessible within the
Report Browser only by you. They only appear in report search results for you.

The number of reports in a category is displayed in parentheses following the category name. In the
example below, categories exist for Standard, Shared, and Personal reports, but only the Standard
Report categories are populated with reports.
Shortcuts

Clicking a category displays a list of shortcuts to reports in that category. Each shortcut displays the title,
name, and description of the report, plus the type or class of data for which the report is defined.

In the example below, all the reports are Standard reports. Clicking the Work Management link will
display only reports in that category. To display all available reports, click the magnifying glass ( ) with
no search text.
Each report can be assigned to multiple categories, so you may see several shortcuts to the same report.
You can drag and drop any shortcut to a report into one of your Personal report categories. You can also
drag and drop a shortcut to any of your Personal reports to a Shared report category to share it with
others.

Right-clicking a report shortcut also lets you:

 Delete the shortcut (if it is one of your own personal shortcuts).

 Copy the shortcut to a different category — any Personal or Shared category.

 Edit the shortcut, changing its title or description.

Search:

Use the search box in the left-hand panel above the report categories to find reports by entering text
and clicking the magnifying glass ( ) under Find Reports. Search is limited to the names, titles, and
descriptions of reports to which you have access.

In the image below, a search for the keyword "effort" yields all reports you have access to with the word
"effort" in the title and/or description. To display all available reports, click the the magnifying glass ( )
with no search text.

For V5 Reports

V5 reports (base on List View and Summary View rules) open in the V5 report viewer, not the V6 Report
Viewer described here. The V5 report viewer provides only limited user interaction capability and no
ability to save or share reports.
Comparing Report Definition, List View, and Summary View reports

Reports and charts produced by report definition rules (Rule-Obj-Report-Definition rule type) allows a
wide variety of user interactions with the displayed results. Report definition rules are similar to the two
other types of report rules: list view rules and summary view rules. Report definition rules provide much
of the functionality of these earlier rule types, plus new features, and are easier to define than the older
rules.

Introduced in V6.1, report definition rules have several advantages when compared with list view rules
and summary view rules (known as V5 reports), and use of report definition rules is generally
recommended for newly developed V6.1+ applications.

However, the most appropriate approach for a specific reporting need depends on several factors, and it
is important to understand both the benefits and limitations of each type. The table below summarizes
these capabilities.
When and how to use sub-reports in Report Definition reports

A sub-report is a Report Definition report that provides some or all of its results to another Report
Definition report that invokes it. Using a Report Definition rule as a sub-report does not change the rule
in any way, and the original report can still be accessed directly in its own right.

Users can designate sub-reports within Report Definition reports to simplify assembling data from
several classes, or to satisfy complex conditions.

For example, the requirements for a report might state: "For each operator, show information (ID, label,
status, last update) for the last work item they updated within a given work type." A way to accomplish
this would be:

1. Create a sub-report that retrieves the most recent update date by update operator within the
work type.

2. Create the main report to select the task information for all work items.

3. Within the main report reference the sub-report, matching the update operator and the update
date columns in the two reports.

4. Display data about those work items that satisfy the criteria for both reports.

Approach:

The general procedure has four steps:

1. Analyze the requirements for the report to identify information a sub-report could provide.
2. Create one or more sub-reports that provide that information.
3. Create a main report, and use information from the sub-report or sub-reports.
4. Verify that the reports requirements have been satisfied.

Note that, while you can create reports and potential sub-reports in the Report Browser and Report
Viewer, you must open the main report's rule form in the Designer Studio and specify its sub-reports on
the rule form's Data Access tab.

Note also that you can review the SQL statement the Report Definition rule creates by running the
report and then clicking the clipboard icon to display the clipboard. Click
UserPages > pyReportContentPage (Code-Pega-List) and review the contents of the pxSQLStatementPost
property.

Four use cases

 Use Case 1: For each operator, show task information for the work item the operator most
recently updated within a specific work type. The task information should include work item ID,
label, status, and date last updated.

This use case illustrates using a sub-report to select the data to include
 Use Case 2: List the operators who have not updated work items of a specific type within the
past week.

This use case illustrates using a sub-report to select the data to exclude.
 Use Case 3: List the managers in a specific division who have more than ten direct reports.

This use case illustrates using a calculated value from a sub-report in the main report.
 Use Case 4: List the average number of direct reports for the managers in a specific division.

This use case illustrates using multiple sub-reports in a single main report.

Use Case 1: For each operator, show task information for the work item the operator most recently
updated within a specific work type. The task information should include work item ID, label, status,
and date last updated.

Plan: Create a sub-report to list the most recent updates by all operators. Match the data from that sub-
report to the data of a report of when all work items were updated. Where there is a match between
the date/time of a work item's update and the most recent update date/time for an operator, include
information about the work item and the person who last updated it.

Steps

1. Create the report definition rule for the sub-report, and save it in the class of the work type on
which you want the report. On the Design tab, give the report two columns: the first column
holds the operator IDs of operators who created or updated work items. The second column
holds the "MAX" (highest) date-time for that operator in the .pxUpdateDateTime values for all
the work items in the class.
2. The sub-report includes a single row for each operator who has created or updated a work item,
showing the date and time of that person's most recent action. Save and run the sub-report to
see the requested data.

3. Create the report definition rule for the main report. Give it five columns to hold the requested
data for each work item: update operator, work item ID, work item label, status, and the update
date and time.

4. On the Data Access tab, add the sub-report. You refer to its properties in the main report by a
text prefix that you specify here.
5. Click the Configure button to display the Configure Sub-Report form. This is where you specify
how data from the sub-report is joined to the data in the main report.

 In the Number of Rows... area select More than 1 Row.


 In the Where will you use this Sub-Report? area, check all three checkboxes. This lets the sub-
report and its columns appear as options in selection menus on both sides of filter conditions
you set, and in the Columns to Include section on the main report's Design tab.
 In the How will you join results... section, set a filter condition to join data from the sub-report
to the main report where the value in the sub-report's Update Operator column matches the
value of property .pxUpdateOperator in the main report.
 Set the relationship to only include matching rows from both reports.
 In the How will you refer to columns in Sub-Report... section, provide an alias for each column
you want to reference in the Sub-Report. The aliases appear as SmartPrompt options in
selection menus in the main report.
 Click OK to save the configuration. Click Cancel to close the form without saving your edits.
6. On the Design tab, in the Rows To Include section, add a filter condition as in the image below.
Work items are included only if the work item's update date/time exactly matches a date/time
entry in the sub-report.

o The Filter Conditions field must refer to every filter you create, using the Conditions field
entries.
o In this case, your condition is that the work item's .pxUpdateDateTime value Is Equal to
sub.Update_Date_Time, the value in the sub-report.

7. Save and run the report. The Filters line above the report data summarizes the filter you
established.

The report shows, for each operator, information about the work item the operator most
recently updated.
Use Case 2: List the operators who have not updated work items of a specific type within the past
week.

Plan: Create a sub-report that lists all the operators who have updated work of a specific type within the
past week. Use the sub-report as a filter, comparing with a list of all operators and removing all entries
where there is a match between the two reports.

Steps

1. Create a sub-report in the class of the work types to report on. On the Design tab, give the report a
single column, listing the update operators for all work items.

In the Rows To Include section, add a filter condition so the report only includes update operator IDs
from work items that have been updated in the last seven days.

When you select a column that holds date/time data, you can select in the Relationship field from a
series of symbolic dates such as "Today", "Last Month", or, in this case, "Last 7 Days".

2. Run the sub-report to see the list of update operators for work items that meet the filter conditions.
3. Create the main report definition rule in the same class as the work items on which it reports. On the
Design tab, give this report only one column, which holds the operator IDs of the operators who have
not updated work items in the period selected in the sub-report.

4. On the Data Access tab, reference the sub-report. You refer to its properties in the main report by a
text prefix you specify here.

5. Click the Configure button to display the Configure Sub-Report form. This is where you specify how
data from the sub-report is joined to the data in the main report.
 In the Number of Rows... area select More than 1 Row.

 In the Where will you use this Sub-Report? area, check the Right Hand Side of Filter conditions
checkbox. This lets the sub-report and its columns appear as options in selection menus on the
right side of filter conditions you set on the main report'sDesign tab.

 In the How will you join results... section, you do not need to specify a filter.

 Since you have no filter, set the filter relationship to Do not match rows.

 In the How will you refer to columns in Sub-Report... section, provide an alias for each column
you want to reference in the Sub-Report. The aliases appear as SmartPrompt options in
selection menus in the main report.

 Click OK to save the configuration. Click Cancel to close the form without saving your edits.

6. On the Design tab, in the Rows To Include section, check the Remove Duplicate Rows checkbox. Add a
filter condition to exclude any entry where the update operator ID matches the update operator ID of a
row in the sub-report (the people who recently updated work items).

 The Filter Conditions field must refer to every filter you create, using the Conditions field entries.

 In this case, your condition is that the work item's .pxUpdateDateOperator value Is Not Equal to
sub1.Update_Operator, the value in the sub-report.

7. Save and run the report. The Filters line above the report data summarizes the filter you established.

The report shows operators who did not update work items in the past week, and who therefore were
not included in the sub-report.
Use Case 3: List the managers in a specific division who have more than ten direct reports.

Plan: Presume that the division is "Engineering".

Create a sub-report that finds anybody people in the division report to, and counts up how many direct
reports each person has. Then, in the main report, show only information from the sub-report if the
number of direct reports is greater than ten.

Steps:

1. Create a sub-report that applies to Data-Admin-Operator-ID. Save it in any convenient class in your
application.

2. On the Design tab, in the Columns To Include section,, give the report two columns. The first column
displays the operator ID of anyone who has a direct report. The second column counts the number of
direct reports.

Note: Although the Column Name field in each column is marked as required, it is not required for a
column using the COUNT summary function.

3. In the Rows To Include section, add two filter conditions to limit the data to operators who are part of
the Engineering division and report directly to someone.

The Filter Conditions field must refer to every filter you create, using the Conditions field entries.
In this case, the entry is A AND B.

The A condition looks for operators whose .pyOrgDivision property equals "Engineering". The B
condition looks for operators whose .pyReportTo property is not null. Both conditions must be
true for the operator to contribute to the report results.
4. Run the sub-report to see the operators who have direct reports, and how many they have.

5. Create the main report definition rule. Set its AppliesTo key part to Data-Admin-Operator-ID.

6. On the Data Access tab, in the Sub-Reports area, add the sub-report. You refer to its properties in the
main report by the prefix you specify here.

7. Click the Configure button to display the Configure Sub-Report form. This is where you specify how
data from the sub-report is joined to the data in the main report.
 In the Number of Rows... area select More than 1 Row.

 In the Where will you use this Sub-Report? area, check all three checkboxes. This lets the sub-
report and its columns appear as options in selection menus on both sides of filter conditions
you set, and in the Columns to Include section on the main report'sDesign tab.

 In the How will you join results... section, set a filter condition to join data from the sub-report
to the main report where the value in the sub-report's Update Operator column matches
.pxUpdateOperator in the main report.

 Set the relationship to only include matching rows from both reports.

 In the How will you refer to columns in Sub-Report... section, provide an alias for each column
you want to reference in the Sub-Report. The aliases appear as SmartPrompt options in
selection menus in the main report.

 Click OK to save the configuration. Click Cancel to close the form without saving your edits.

8. On the Design tab, in the Columns To Include section, create two columns. The first column holds the
operator IDs of those who have direct reports. The second column has the count of those reporting to
each listed operator, drawn from the sub-report "Count_of" column.

9. In the Rows To Include section, check the Remove Duplicate Rows checkbox. Create a filter to use only
data from the sub-report where the number of reports-to instances is greater than ten.

The Filter Conditions field must refer to every filter you create, using the Conditions field entries.
In this case, the entry is A.

The A condition looks entries where the count in the Count_of column is greater than 10.

10. Save and run the report. The Filters line above the report data summarizes the filter you established.
There are now only three entries, those operators who each have more than ten members of the
Engineering division reporting to them.

Use Case 4: List the average number of direct reports for the managers in a specific division.

Plan: Presume that the division in question is "Engineering".

Create a sub-report counts the number of operators who belong to the Engineering division. Create a
second sub-report that lists the division members to whom others report directly.

Then, in the main report divide the value from the first sub-report by the value from the second sub-
report, to find the average number of direct reports for each team member to whom others report.

1. Create a sub-report that applies to Data-Admin-Operator-ID.

On the Design tab, in the Columns To Include section, give the report a single column, providing a
COUNT of the number of operator IDs that match the filter condition you set in the next step.

2. In the Rows To Include section, add a filter condition so the report includes only operators
whose .pyOrgDivision property equals "Engineering". Set the Filter Condition field to "A", matching the
entry in the Condition column for the filter.
3. Run the first sub-report. It returns an ID count of the members of the Engineering Division.

4. Create a second sub-report, saving it to the same RuleSet and Version as the first sub-report. Set its
Applies To class to Data-Admin-Operator-ID.

On the Design tab, in the Columns To Include section, give the sub-report a single column. Use the
COUNT DISTINCT summary function. The column shows the number of distinct entries the report finds in
the .pyReportsTo property of operators who satisfy the filter condition you set in the next step.

5. In the Rows To Include section set the same filter condition as you did in the first sub-report.

6. Run the second sub-report. It returns the number of managers (those with direct reports) in the
Engineering Division.

7. Create the main report, with the same Applies To. Save it into to the same RuleSet version as the two
sub-reports.

On the Data Access tab, in the Sub-Reports section, add the two sub-reports. You refer to them on the
Design tab by the tex prefixes you provide here
8. For each sub-report, click the Configure button to display the Configure Sub-Report form. This is
where you specify how data from the sub-report is joined to the data in the main report.

 In the Number of Rows... area select 1 Row.

 In the Where will you use this Sub-Report? area, check the first and third checkboxes. This lets
the sub-report and its columns appear as options in selection menus on the right side of filter
conditions you set, and in the Columns to Include section on the main report'sDesign tab.

 In the How will you join results... section, you do not need to set a filter condition.

 Since you have no filter condition, set the relationship to Do not match rows.

 In the How will you refer to columns in Sub-Report... section, provide an alias for each column
you want to reference in the Sub-Report. The aliases appear as SmartPrompt options in
selection menus in the main report.

 Click OK to save the configuration. Click Cancel to close the form without saving your edits.

9. On the Design tab, add a column that draws the count of employees from the first sub-report. To
locate the property name, type the prefix of the sub-report in the Column Name field, followed by a
period. Click the down-arrow to see a list of all the columns in the sub-report, and select the one you
want. (In this case, since there is just one column, the choice is easy.)
10. Following the procedure from the previous step, add a column that draws from the second sub-
report the number of managers.

11. Add a third column. Click the Function Builder icon to create a function to populate this column.

The Function Builder appears in a pop-up window. It provides a large number of functions to select
from, and displays additional input fields depending on the function you select.

In the Select a function field, enter "divide" and click the down arrow. Select the function that appears.

The Function Builder provides two Function Input fields for the properties the selected function
requires. Enter the name of the first sub-report, followed by a period, in the first field, click the down
arrow, and select the column you want from the display. Similarly, select a column from the second sub-
report for the second field. Click Submit to save the function.

The main report now has three columns:


12. Save and run the report. It displays the number of members of the Engineering Section and the
number of managers, and calculates the average number of direct reports per manager. Since you
applied no filters to the data in the main report, the Filters entry lists "none".

By using sub-reports, you can construct Report Definition reports that can provide precisely the data
needed for a situation.
How to schedule reports and subscribe to scheduled reports

A user who has access to the Report Browser can schedule reports and subscribe to the reports others
have scheduled. Managers can create schedules and manage subscriptions without relying on developer
help.

The Report Browser is available through the standard composite portals such as the Case Management
and Manager portals; the Report Browser may also form part of custom composite portals.

From the Designer Studio, you can access the Report Browser by clicking > Reporting > Report
Access > Report Browser.

The next section reviews how you can:

 Schedule a report
 Subscribe to a scheduled report
 Unsubscribe from a report

Schedule a report:
To work with reports, you must have an unlocked dedicated RuleSet version available. This allows your
to check out Report Definition rules, and to store categories and report shortcuts you create

1) Open the Report Browser and locate a category that holds a report to which you want to
subscribe. In general, you can subscribe to:
 Reports in the Standard Reports categories
 Shared Reports created and made available by colleagues
 Reports in your Personal Reports categories. These may be reports you created or modified
yourself, or shortcuts to other reports.
1) Select a category and right-click on a report. The Report Information form appears

2) If you can subscribe to the report, the Schedule button appears. Click it to display the Schedule
Reporting Task form. The form has three sections:
 Task Definition
 Task Scheduling
 Task Output Processing

Complete each section as described below, then click Submit to schedule the report. Click
Cancel to close the form without setting a schedule.

Task Definition

The Task Definition section displays existing information drawn from the report. You can update the
scheduling task name or description, or accept the defaults.

Task Scheduling

By default the Task Scheduling section assumes that the report will run once. If this is the case, set the
time of day and the date.

If the report is to run as a recurring task, click that radio button. Additional fields appear, where you can
set the frequency and limits of the report.

In the Frequency control, select how often the report runs.


Depending on your selection, additional fields appear. In the example below, with Weekly selected as
the frequency, fields appear where you specify the number of weeks the report should run, and on
which day or days of the week. Appropriate fields appear to support other frequency selections.

In the next section, specify the date when the report starts running.

You can specify no end date, a specific end date, or that the report execution should end after it has run
a certain number of times.

Task Output Processing

In the Task Output Processing section, set how, and in what format, the scheduled report communicates
with subscribers.
For Output File Format you can select PDF or Excel Workbook.

If you want others to be able to subscribe to this report, check the Enable authorized users... checkbox.

The report scheduler is automatically subscribed to the report. You can add other report recipients: add
a row to the list, type a few letters of an intended recipient's name or operator ID, and click the down
arrow. Choose a recipient from the options that appear.

You can opt to attach the report to the notification the task sends, or to include in the report a link to
the report results.

Click Configure Notification Message to display the Email Parameters form. Provide the subject line and
message for the report notification, using the rich text editor.

Click OK to save the email contents; click Cancel to close the form without saving your work.

To set the report schedule, click Submit on the main form. Click Cancel to close the form without saving
your changes.

Subscribe to a scheduled report

When you view the list of reports in a category in the Report Browser, scheduled reports have one of
two icons in the Scheduled column.

If the report is scheduled, but you are not subscribed to it, an envelope with an X appears:
If you have subscribed to a report, the envelope appears with a green check mark.

To subscribe to a report, right-click on the report entry. The Report Information form appears.

Click Subscribe, and click Subscribe again in the form that appears to confirm the subscription. The
envelope-with-checkmark icon appears for the report in the Scheduled column

Unsubscribe from a report

To unsubscribe from a report, right-click on the entry for a report to which you are subscribed. In the
Report Information form that appears, click Unsubscribe.

Click Unsubscribe in the next form to confirm ending your subscription.

You might also like