Sie sind auf Seite 1von 109

PRPC: Bootcamp Answer

Keys

PRPC Version:

Course ID:
© Copyright 2012

Pegasystems Inc., Cambridge, MA

All rights reserved.

This document describes products and services of Pegasystems Inc. It may contain trade secrets and proprietary
information. The document and product are protected by copyright and distributed under licenses restricting their use,
copying distribution, or transmittal in any form without prior written authorization of Pegasystems Inc.

This document is current as of the date of publication only. Changes in the document may be made from time to time at the
discretion of Pegasystems. This document remains the property of Pegasystems and must be returned to it upon request.
This document does not imply any commitment to offer or deliver the products or services described.

This document may include references to Pegasystems product features that have not been licensed by your company. If
you have questions about whether a particular capability is included in your installation, please consult your Pegasystems
service consultant.

For Pegasystems trademarks and registered trademarks, all rights reserved. Other brand or product names are trademarks
of their respective holders.

Although Pegasystems Inc. strives for accuracy in its publications, any publication may contain inaccuracies or
typographical errors. This document or Help System could contain technical inaccuracies or typographical errors. Changes
are periodically added to the information herein. Pegasystems Inc. may make improvements and/or changes in the
information described herein at any time.

This document is the property of:

Pegasystems Inc.

101 Main Street

Cambridge, MA 02142-1590

Phone: (617) 374-9600

Fax: (617) 374-9620

www.pega.com

Document: PRPC: Bootcamp Answer Keys

Updated: 6/21/2012
Table of Contents

Review the Application Profile 1

Run the Application Accelerator 3

Create the Draft Flows 5

Create the Draft UI 11

Create the Data Model 21

Capture Baseline Performance Data 25

Collect Customer Information 27

Allow Sales Agents to Select Order Items 39

Review and Submit Orders 49

Route Sales Orders for Manager Approval 53

Conduct Functional Performance Testing 55

Create a Work Party 57

Send Notifications to a Work Party 61

Review and Select Previous Orders 67

Create Sales Order Reports 77

Conduct Final Performance Testing 81

Case Management 83

Submit an Order from the Web 89

Update the Inventory Database 97

Configure an SLA 103

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved iv
Review the Application Profile

Scenario
Business architects (sometimes referred to as business analysts) use the Application Profile (AP) to gather requirements,
capture business objectives, and estimate the scope of work. The Application Profile wizard provides us with tools and
processes to reduce the complexity and time required to capture all relevant aspects of a process, from the discovery of
the business to details such as the resources required for the project.

Tasks
You have been asked to review the application requirements captured in the Application Profile.

Note: When building the application, refer to the specifications in the Application Profile document for in-depth
requirements to complete each development task.

How To Do It
1. Open the existing Application Profile (AP-1) on your system.
a. From the Application menu, click New Application > Profiles in Progress.

b. Click AP-1 in the list of Application Profiles in Progress.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 1
2. Use the Actions menu to review the project overview and actors.
a. From the Actions menu, click Overview and review the entries. Click Cancel to close the Overview dialog.

b. From the Actions menu, click Actors and review the entries. Click Cancel to close the dialog.
3. Step through the profile, reviewing each step, and then complete the Application Profile. Use the Instructions icon
to view the help text associated with the screen.
a. Review the entries and click each tab to progress to the next step.
b. Click the Instructions icon located on the right to view the help text associated with the screen.
c. When you reach the last tab, click Finish to submit the Application Profile.
4. Close the Define Application Profile tab to exit the Application Profiler.

2 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Run the Application Accelerator

Scenario
The Application Accelerator (AA) is used by Senior System Architects (SSAs) and Lead System Architects (LSAs) to
create the class structure and baseline rules for applications. (On some projects, system architects may participate in this
process.) The LSA or SSA uses the Application Profile (AP) as an input, using the information collected by a business
architect during the discovery process to quickly create a starting point for the application.

Tasks
You have been asked to perform the following SSA/LSA tasks:

l Run the Application Accelerator, using AP-1 as an input.


l Change the organization to ABC.com and the division to Sales.
l Create the application starting point.

How To Do It
1. Launch the Application Accelerator, and use the information provided in Application Profile AP-1 as a starting point.
a. From the Application menu, click New Application > Application Accelerator.
b. In the Application Overview dialog, select AP-1 from the list of profiles.
c. Review the information about the project.
2. Create the following organization structure for the application, then create the test operators.
Organization Division
Name ABC.com Sales

a. Close the Application Overview dialog to advance to the Base and RuleSets step.
b. Change the Organization Name to ABC.com.
c. Change the Division Name to Sales.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 3
d. Select Create test operators.

3. Click each tab of the Application Accelerator to review the information that will be used to create the classes and
baseline rules of the application.
4. When you reach the Review Application tab, review all the rules that will be created, and then click the Class
Structure tab to review the class structure.
5. Build the application starting point. Once the Application Accelerator finishes, switch to the new application.
a. Click Build the Application to create all the rules.
b. After the Application Accelerator has completed, click Finish.
c. Click Switch to new application.

Note: Clicking Switch to new application changes the work pool and refreshes the Application Explorer. This allows
PRPC to display the class structure and baseline rules that were created for the Sales Order application.

4 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Create the Draft Flows

Scenario
The first step in building an application is to create draft flows. Draft flows are used to quickly model a process, without
first creating all of the required rules. This allows us to verify the business process with stakeholders and get their buy-in,
before we create individual forms and the data model.

These flows orchestrate our process (in this case, the Sales Order process) by sequencing the presentation of work forms
outlined in the specifications. A draft flow should include all of the steps we anticipate for the process. Each step should be
documented with the appropriate specification collected in the Application Profile.

Tasks
You have been asked to modify (or replace, if necessary) the draft flows created by the Application Profiler and Application
Accelerator.

How To Do It
1. Disable rule check-out on the framework RuleSet.
Best Practice: When developing an application in a multi-developer environment, you should never disable rule
check-out, as this allows developers to overwrite each other's rules. However, in this training environment, you can
disable rule check-out for your convenience.

a. Click > Application > Structure to access the RuleSet Stack gadget.
b. Click SalesOrderFW:01-01-01 to open the RuleSet.
c. On the Security tab, clear the Use check-out? checkbox.
d. Save the RuleSet.
2. Add the following specifications to the corresponding Subprocess shape in the StartSalesOrder flow.
Subprocess Specification
Agent Collects Order Info AgentCollectsOrderInfo
Manager Reviews Order ManagerReviewsOrder

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 5
a. Right click on the first Subprocess shape and click Properties to open the Properties panel.
b. In the Properties panel, for Specification select AgentCollectsOrderInfo.

c. Repeat steps 2.a and 2.b to add the ManagerReviewsOrder specification to the second Subprocess shape.
d. Save the flow.
3. Replace the AgentCollectsOrderInfo flow rule created by the AA with a tabbed screen flow of the same name, to
better allow sales agents to gather information about the sales order, and save the flow as a draft flow.

a. Delete the AgentCollectsOrderInfo flow rule.


b. Right-click ABC-FW-SalesOrderFW-SalesOrder and select New > Process > Flow to open the New
Rule dialog.
c. For Flow Name enter AgentCollectsOrderInfo. In the Template area, for Name, select ScreenFlow.

d. Click Create.
e. When the AgentCollectsOrderInfo flow opens, delete the Perform Task assignment.
f. Create the following three assignments, in order, and add the corresponding flow actions and specifications
to each assignment. Do not create the flow action rules at this time.

6 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Assignment Instructions Flow Action Specification
Review Previous Review the customer's previous Review- Review-
Orders orders PreviousOrders PreviousOrders
Select Order Items Select the items for this order SelectOrderItems SelectOrderItems
Review Order Items Review items for this order ReviewOrderItems ReviewOrderItems

g. Right-click the Start shape, and click Properties. In the Properties panel, select the TabbedScreenFlow
harness. Update the remaining fields using the information in the following table.
Field Value
Application SalesOrderFW
Work Type SalesOrder
Specification AgentCollectsOrderInfo

h. Click the Turn Draft Model ON icon to turn on draft mode


i. Save the flow.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 7
4. Modify the ManagerReviewsOrder flow to rename the Approve Sales Order to Review Sales Order. Add Reject
and Approve connectors to this assignment. Add specifications, work statuses and instructions to the assignment,
the connectors, and the Update Status utility shapes.
a. Right-click the Approve Sales Order assignment. In the Assignment Properties panel, on the Assignment
tab, change the Name to Review Sales Order.
b. In the Assignment Properties panel, click the Status tab. In the Work Status field, select Pending-
Approval.
c. Reposition the Reject Sales Order connector to start from the Review Sales Order assignment. Delete the
Reject Sales Order assignment.
d. Click the Display Likelihood icon to view the likelihood on each connector in the flow.
e. Open the Properties panel for the Approve Sales Order connector. For Flow Action, select Approve and
change the Likelihood to 95.
f. Open the Properties panel for the Reject Sales Order connector. For Flow Action, select Reject and change
the Likelihood to 5.
g. Right-click the Update Status utility that is connected to the Reject connector. In the Properties panel, for
Rule, select UpdateStatus, and for StatusWork, select Resolved-Rejected.
h. Repeat the previous step on the other Update Status utility to set the work item status to Resolved-
Completed.

i. If the flow is not already in Draft mode, enable Draft mode for the flow.
j. Save the flow.
Note: When you save the flow for the first time, PRPC prompts you with the following warning about saving
the flow with changes made outside of Visio.

8 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Since you will not use Visio to edit flow rules in this course, click Continue with save and remove Visio
editing for this flow.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 9
Create the Draft UI

Scenario
Developers create a mocked-up, or draft, UI to help verify the sequence of steps in a draft flow. The draft UI is a rapidly
built Proof of Concept (PoC) that a developer can share with business analysts, SMEs, executives and other stakeholders
for review. This review allows the project stakeholders to propose changes if necessary and sign off on the design before
investing significant development effort.

In this exercise, you will create the UI for each step in your draft flows. Remember the following guidelines when building
the UI:

l Do not create any part of the data model at this time.


l Do not format your fields to make them look like the mockups, though you do want to use the appropriate browser
control (text field, drop-down list).
l Concentrate on how the UI should look, not how the UI should work. Your goal is to provide enough detail in each
form to obtain approval from the business stakeholders.

Tasks
You have been asked to create draft sections for each work form used in the Sales Order process. Refer to the Application
Profile specifications and the following examples.

Customer Information:

Review Previous Orders:

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 11
Select Order Items:

Review Order Items:

Manager Reviews Sales Order: (Approve)

12 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Manager Reviews Sales Order: (Reject)

How To Do It
1. Create a mockup of the Customer Information work form in the class group. Create a section for the Customer
Information screen, and then create the section for each tab.
a. Create the ShippingProfile section in the class group.
i. In the Application Explorer, right-click User Interface and click New > Section. In the Purpose field,
enter ShippingProfile, then click Create.
ii. In the Label cell, use the following table to enter the values. Click the Insert Row After icon to append
more rows.
Label
Company Name
Address
City
State
Postal Code
Country
Phone Number
iii. From the Basic palette, drag a Text Input and place it in the Field column for the Address label.
Either repeat the process of dragging Text Input controls from the palette to the layout, or right-click
the control and select Copy, then right-click each empty cell and select Paste to copy the Text Input
control to the other cells.
iv. Click the Show Wireframes icon to show the layout and then open the Properties panel. For Format,
select A, and then for Title, enter Shipping Information. On the General tab, for Header Type, select
Bar.
v. In the Properties panel for the layout, click Allow Changes to Columns, and click OK. In the layout,
delete the unused columns.
Note: Deleting the unused columns allows you to reduce the width of the layout, which improves the
appearance of the layout when embedded in another section. Using the Single template would extend

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 13
the Field column so that the layout would be as wide as a layout using the Double template.

b. Repeat step 1.a to create a section named CompanyProfile in the class group. Add the following labels and
controls to the layout, and delete the unused columns. Title the layout Customer Information.
Label Control
Company Name
Contact Name Text Input
Contact Title Text Input
Contact Email Text Input
Phone Text Input
Fax Text Input

c. Create a section named CustomerInformation in the class group. In the first row, add an auto complete
control labeled Company Name.
Note: Do not configure the Auto Complete control at this time. You will configure this control in a later
exercise. Remember that your goal is not to create a fully-functional UI, but rather to create a UI to show to
the stakeholders and get their approval.
i. Create the CustomerInformation section in the ABC-FW-SalesOrderFW-Workclass.
ii. From the Advanced palette, drag an Auto Complete into the first Field cell of the existing layout.
iii. In the Label cell to the left of the control, enter Company Name.

14 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
d. In the CustomerInformation section, create a tabbed layout that contains the CompanyProfile and
ShippingProfile sections. Modify the title of each tab to match the section name.
Note: Remember to delete the tab that contains the empty Smart Layout.

i. From the Layout palette, drag a Tab and drop it below the existing Smart Layout.
ii. From the Layout palette, drag a Section and drop it next to the tab. In the Include Section Rule
dialog, for Purpose, select CompanyProfile. Click the properties panel of the tab and in the Title
field, enter Company Profile.
iii. Repeat steps 1.d.i and 1.d.ii to add a tab for the ShippingProfile section. Title the tab Shipping
Profile.
iv. Click the Title tab, then click the delete icon to delete the empty tab.

e. Save the section and then click the Preview icon to review the section. If the Shipping Profile tab is the
active tab, return to the rule form and click the Company Profile tab, then save the rule.
2. Open the New harness (found in the class group), delete the contents of Container 1, and then add the
CustomerInformation section to the container. Title the container Enter Customer Information.

a. Click the Show Wireframes icon.


b. Click on Container 1, then click the Delete Row icon to delete the included sections and layouts.
c. From the Application Explorer, drag the CustomerInformation section into the now-empty container.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 15
d. Open the Properties panel for Container 1. For Title, enter Enter Customer Information. On the General tab,
for Header Type, select Bar.

e. Save the New harness.


3. From the run menu select Run Process > StartSalesOrder Main Flow to run the process.
4. Create a section named ReviewPreviousOrders in the class group, to display the previous orders for the selected
customer.
a. Create a section named ReviewPreviousOrders in the ABC-FW-SalesOrderFW-Work class.
b. Add a free-form layout to represent previous order data. Add labels for the layout, and enter sample data for
each row, as indicated in the specification.
i. From the Layout palette, drag a Layout onto the section. In the Set Layout Type dialog, select Free
Form and enter 4 Cols and 3 Rows.

ii. Enter the labels Order ID, Order Date, and Grand Total in the first row, starting with the left column.
iii. In the second and third row, enter the following sample data in the corresponding column:
Order ID Order Date Grand Total
SO-26 7/14/2011 548.39
SO-80 8/4/2011 629.12
c. Delete the empty Smart Layout.

16 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
d. In the right-most column of the first row, add a button labeled Add to Order.

i. From the Basic palette, drag a button to the right-most cell in the first row.
ii. Open the Properties panel for the button.
iii. Click the Configure Control icon .
iv. In the Label field, enter Add to Order.
v. Click OK to return to the Properties panel.
vi. Click OK to close the Properties panel.
e. View your changes using the preview icon.
i. Save the section.
ii. Click the Preview icon to view your changes.
5. Create a flow action named ReviewPreviousOrders in the class group and then drag the ReviewPreviousOrders
section onto the flow action.
a. In the application explorer, right on click on class group name and then and select New > User
Interface> Flow Action to create a new flow action.
b. In the Action Name field, enter ReviewPreviousOrders.
c. From the Application explorer, drag ReviewPreviousOrders section and drop it inside the flow action rule.
d. Save the flow action.
6. Run the process. Click Create to navigate to the Review Previous Orders tab.
7. Create a section named SelectOrderItems in the class group, to display a form listing the items that can be selected
for the order.
a. Create the SelectOrderItems section in the ABC-FW-SalesOrderFW-Work class.
b. From the Basic palette, drag a Calendar and drop it in the field cell of the first row. In the corresponding
Label cell, enter Date Submitted.
c. Drag a new layout below the existing layout. In the Set Layout Type dialog, select Repeating Grid.
d. Change the edit mode for the grid to Read/Write.
i. Open the Properties panel for the Repeat Grid.
ii. From the Edit mode drop-down list, select Read/Write.
iii. Click OK.
e. Use the following table to add labels to the title row and UI controls as needed. Select a column in the grid
and click the Insert Column After icon to add more columns. Drag the specified controls from the Advanced
palette.
Labels Controls
Product ID
Category Select
Product Select
Unit Price
Qty on Hand
Qty Requested Text Input

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 17
Labels Controls
Line Total
f. Add a new Smart Layout below the grid. In the first Label field, enter Grand Total.

g. Create the SelectOrderItems flow action in the ABC-FW-SalesOrderFW-Work class, and then add the
SelectOrderItems section to the flow action. Run the process and navigate to the Select Order Items step
to verify your mockup.
Note: The Select you added to the layout uses the PromptSelect control to display a drop-down list that
contains static data. When you create the actual UI, you will replace these PromptSelect controls with
DynamicSelect controls, which can display data from outside sources, such as an external database. You
can use the DynamicSelect control in your draft UI, but this causes errors when you add or remove list rows.
While you can ignore these errors in a draft UI, you may wish to avoid them when demonstrating the UI to
stakeholders.
8. Create a new section named ReviewOrderItems in the class group. This section will provide a summary of the
selections made in other screens.
a. Create the ReviewOrderItems section in the ABC-FW-SalesOrderFW-Work class.
b. Add the CompanyProfile and ShippingProfile sections onto this section, using a free-form layout.
i. Add a free-form layout of 2 columns and 1 rows to the top of the section.
ii. Delete the existing Smart Layout.
iii. From the Application Explorer, drag the CompanyProfile section into the first column.
iv. From the Application Explorer, drag the ShippingProfile section into the second column.
v. If necessary, adjust the width of the first cell so the shipping information fields are placed right next to
the customer information fields.

18 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
c. From the Basic palette, drag a section and drop it below the freeform layout. In the Include Section Rule
dialog, for Purpose, select SelectOrderItems.

d. Add the ReviewOrderItems section to a new flow action named ReviewOrderItems.


e. Run the process, and then navigate through the three screens in the screen flow.
Tip: If time allows, return to the ReviewOrderItems section and apply the Accordion header to the sections
on the form to see how their appearance changes at run-time.
9. Create a section named Approve in the ABC-FW-SalesOrderFW-Work class. Add the ReviewOrderItems
section, then delete the empty Smart Layout.
10. Run the process and then click Finish to see the Approve screen.
Note: You do not need to create the flow action to call this section, or the Reject section you create in the next step.
When you run the process, PRPC calls the standard Approve (or Reject) flow action, which in turn references a
section of the same name. Rule resolution then calls the most-specific section with that name – which you create in
this exercise.
11. Create a new section named Reject and add a text area labeled Enter Rejection Note.
a. Add a Text Area control to the field cell.
b. Add the label Enter Rejection Note.

12. To view the Reject form, run the sales order process to the Approve screen, then click Other Actions and select
Reject.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 19
Reference Materials
l PRKB-26207 – How to model the user interface of your application before all properties are defined.

20 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Create the Data Model

Scenario
ABC's Sales Order application requires data to perform work. Some of this data is collected by the sales agent as they
create a customer order. Other data comes from an external database, which manages product inventory and customer
information for ABC. To capture this data, you need to create data classes and properties – together referred to as a data
model – for the application.

Tasks
You have been asked to:

l Create mappings between the following three tables in ABC's external database and your Sales Order application.
o Customers – information about ABC's customers, such as name, address, and phone number.
o Product – information about the products ABC sells, including quantity in stock and unit price.
o Categories – information used to manage the presentation of product information by grouping items into a
fixed set of categories, such as beverages and condiments. This information allows the sales agent to more
easily select the product sought by the customer.
l Create additional properties to collect the following information.
o Order submission date.
o Total cost for the entire order.
o An explanation for order rejection.
o Quantity requested for each item.
o Total cost for each item.

How To Do It
1. Create the Customers, Product, and Categories data classes and map them to the external Customers, Product,
and Categories database tables, respectively.
a. From the Pega button, click Data Model > Classes & Properties > Database Class Mappings.
b. Click New External Database Table Class Mapping to launch the wizard.

c. Select the ABC database, the CUSTOMERS table, and the SalesOrderFW:01-01-01 RuleSet.
Note: PRPC uses a database record supplied for you to create the connection to the ABC database. In a
real-world implementation, you would need to create this record and supply the JDBC connection string to
the database.
d. Change the default class name from ABC-FW-SalesOrderFW-Work-Data- to ABC-FW-SalesOrderFW-
Data-Customers. Compare your wizard to the example below, then click Save.
Note: The wizard creates the data class you specify, and maps the table columns to properties in the class.
After the wizard is completed, notice that these properties and a data transform rule have been created in the
class.
Note: When using the Database Table Class Mapping wizard to import properties from a database, the
property names are mapped from the column names in the specified table. In DB2 databases, the column

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 21
names are in uppercase. To comply with the PRPC best practice of using mixed-case property names, edit
the entries in the Property Names column to the mixed-case equivalents, as shown in the following example.

e. Repeat steps 1.a - 1.d to create the ABC-FW-SalesOrderFW-Data-Product class.


f. Repeat steps 1.a - 1.d to create the ABC-FW-SalesOrderFW-Data-Categories class.
2. Use the Define Properties wizard to create the properties needed for the application.
a. Right-click the ABC-FW-SalesOrderFW-Work class , then click Define Properties to launch the wizard.
b. Add an embedded page property named Customer, which references the Customers class created by the
Database Table Class Mapping wizard.
c. Add an embedded page list property named ItemList, which references the Product class.

22 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
d. Add the single-value properties GrandTotal (Decimal), RejectionNote (Text), and DateSubmitted (Date).

e. Click Finish.
f. Create the single-value properties QtyRequested and LineTotal in ABC-FW-SalesOrderFW-Data-Product.
i. Right-click ABC-FW-SalesOrderFW-Data-Product and then click Define Properties to launch the
wizard.
ii. In the Define Properties wizard, create two Single Value properties named QtyRequested and
LineTotal.
iii. In the Type field, select Integer and Decimal respectively. Change the description to Qty Requested
and Line Total
iv. Click Finish to create the properties.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 23
Capture Baseline Performance Data

Scenario
PRPC captures the performance indicators during the execution of a process. The Performance Analyzer (PAL) allows
developers to analyze these indicators, to help them improve application performance. PAL can capture an initial snapshot
of system performance, which we can use as a baseline for comparison to system performance after later development
iterations. When conducting this type of performance analysis, we need to focus on the change – or delta – between the
baseline and later readings.

Tasks
You have been asked to run the Performance Analyzer to take a baseline performance reading for the Sales Order process.

Best Practice: You should benchmark your application development process with regular performance analysis at the
completion of major milestones. This allows you to identify performance issues due to application design and correct these
issues prior to releasing the application into production.

How To Do It
1. From the Run menu, click Performance to launch the Performance Analyzer (PAL).
a. Run the process from beginning to end, to force assembly of all the rules used during the Sales Order
process.
Tip: Rules assembly slows down system performance by adding processing time to compile – or assemble
– the rules called during the process. Once PRPC assembles these rules, your application performance can
improve significantly. To avoid skewing your performance readings with rules assembly processing, you
should first run through the process to assemble its rules, then clear those readings and re-run the process to
capture performance data.
b. Close the Process window. Start the process again, but do not advance beyond the New harness. Click
Add Reading to get the DELTA values. The value in the RA Elapsed column should now read 0.00, which
indicates that no rules assembly occurred.
c. In the Performance window, click Reset Data.
d. Click Create and take another reading. Continue navigating through the process and click Add Reading for
each step.
2. Once you have finished running through the entire process, click Save Data to save your readings to your desktop.
As you develop the application iteratively, you will collect PAL information for all user screens.

Reference Materials
l PRKB-24177 - Overview of the Performance Tools (PAL)

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 25
Collect Customer Information

Scenario
ABC wants to collect the customer's information before creating a sales order. This customer information includes
company name, address, city, state, postal code, and contact information for the individual who will receive the order.

When the sales agent selects a customer name from the existing customer list, the customer and shipping information
must be populated automatically.

Tasks
You have been asked to design the Customer Information work form.

Before starting this exercise, refer to the Agent Collects Order Info specification for additional information.

How To Do It:
1. Copy the CompanyProfile and ShippingProfile sections from the class group to the appropriate data class.
Best Practice: Whenever possible, you should save rules that reference properties – in this case, the
CompanyProfile and ShippingProfile sections – in the same class as the properties they reference. This
eliminates the need to refer to the embedded page as part of the property reference, and ensures the proper context
for those property references.
a. Open the CompanyProfile section defined in the class group.
b. Click the Save As icon.
c. In the Save As dialog, change the Applies To class to ABC-FW-SalesOrderFW-Data-Customers, then
click Save As.
d. Repeat steps 1.a - 1.c to save the ShippingProfile section to the ABC-FW-SalesOrderFW-Data-
Customers class.
e. Close the sections in the class group, leaving only the sections in the data class open.
2. Add property references to the CustomerInfomation, CompanyProfile, and ShippingProfile sections.
a. Open the CustomerInfomation section created in ABC-FW-SalesOrderFW-Work.
b. Open the Properties panel for the Company Name field in the Smart Layout. For Property, select
.Customer.CustomerID.
c. Open the Properties panel for the Company Name label in the Smart Layout. Confirm that the Label For
field contains .Customer.CustomerID.
d. On the Pages & Classes tab, add an entry for the .Customer page, as shown in the following example.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 27
e. Change the sections referenced by each tab to use the sections you saved to the data class.
i. Open the Properties panel for the Company Profile tab.
ii. Click the Advanced tab. In the Using Page field, enter .Customer.

iii. Save the page, click the Refresh icon (located in the rule bar), then click the Company Profile
tab to verify that the tab now references the section rule in the data class.
iv. Repeat steps 2.e.i - 2.e.iii for the Shipping Profile tab.
f. Open the ShippingProfile section in the data class and add property references for each field.
i. Add the following properties to the section: .CompanyName, .Address, .City, .Region,
.PostalCode, .Country, and .Phone.
ii. For each label, open the Properties panel and update the Label For field with the corresponding
property name. For the State and Phone Number labels, update the label to match the property
name.
iii. Open the Properties panel for the Company Name field. On the General tab, from the Edit Options
list, select Read Only.
g. Open the CompanyProfile section. Add the properties to the fields, and set the Company Name field to
display as read-only.
i. Add the following properties to the section: .CompanyName, .ContactName, .ContactTitle,
.ContactEmail, .Phone, and .Fax.
ii. Open the Properties panel for the Company Name field and select Read Onlyfrom the Edit Options
list.

28 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
h. Refresh the section and verify your changes.

3. Launch the sales order process. Enter test values in all the fields and then click Create. Close the sales order.
4. Configure the Customer ID auto-complete control to list values from the Customers database table.
a. Create a report definition rule named BrowseCustomers in the Customers data class to return all company
names and customer IDs from the database.
i. In the Application Explorer, right-click Reports and then click New > Report Definition.
ii. In the Applies To field, select ABC-FW-SalesOrderFW-Data-Customers and in the Report Name
field, enter BrowseCustomers.
iii. In the Column Name field, select .CompanyName.
iv. Add a second column. In the Column Name field, select .CustomerID.

b. Click Save & Preview to test the report.


Note: When you view the report, notice that the results span two pages. The default behavior for report
definition rules is to limit each page of a list-type report to 50 rows. When using a report to generate a list of

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 29
data for a control, such as an auto-complete control, the control only displays the results from the first page
of the report. To display all of the results in the control, you must first disable paging for the report.
c. Return to the BrowseCustomers report definition. Click the User Interactions tab, and clear the Enable
Paging check box. Save the report.

d. Configure the Customer ID auto-complete control on the CustomerInformation section rule to use this
report to return all of the company names and IDs from the Customers database table.
i. Return to the CustomerInformation section rule. Click the auto-complete control, and open the
Properties panel.
ii. Click the Configure Control icon to configure the parameters for the control.
iii. In the Applies To field, select the ABC-FW-SalesOrderFW-Data-Customers class, where you
applied the Report Definition rule.
iv. In the Report Definition field, select BrowseCustomers.

v. In the Display Field field, select CustomerID.


vi. In the Minimum Search Characters field, enter 1.
vii. In the First Column Width (%) field, enter 20.

30 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
viii. Select Highlight, Only match the start of string and Send Search Term . Clear the Client Cache
check box.

ix. Under Additional Fields, select CompanyName in the Field column, enter CompanyName in the
Property Name column, and click the Show check box.

x. Click OK and save the section rule.


e. Run the process and enter a in the Customer ID field to test that the auto-complete control displays a list of
company names and IDs.
5. Open the Customer property defined in the class group. Click the Advanced tab, then select Auto-populate
Property.
Note: Enabling auto-populate for a page automatically obtains values for the properties on that page when the
operator provides a value for the class key. In this case, when the sales agent selects a customer ID, our
application automatically populates the fields in Company Profile and Shipping Profile sections, which are defined
in the ABC-FW-SalesOrderFW-Data-Customers class.
6.  Test whether or not the company name is found in the database.
a. Create a property named CompanyNameFound, of type TrueFalse, in the ABC-FW-SalesOrderFW-Data-
Customers class.
b. Create a data transform named SetCustomerInformation in ABC-FW-SalesOrderFW-Work, to set the
value of .Customer.CompanyNameFound to "true" when the company name is found.
i. In the Application Explorer, right-click ABC-FW-SalesOrderFW-Work and select New > Data
Model > Data Transform.
ii. In the Name field, enter SetCustomerInformation.
iii. In the first step of the data transform, in the Target field, select .Customer.CompanyNameFound.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 31
In the Source field, enter "true".
iv. Save the data transform.
c. Create a when rule named IsCustomerFound in the ABC-FW-SalesOrderFW-Data-Customers class, to
test whether the value of .CompanyNameFound is true or false.
i. In the Application Explorer, right-click ABC-FW-SalesOrderFW-Work and select New > Decision
> When to open the New Rule dialog.
ii. In the Applies To field, select ABC-FW-SalesOrderFW-Data-Customers.
iii. In the Name field, enter IsCustomerFound.
iv. In the Condition field, enter .CompanyNameFound.
v. Click Quick Create.
7. Populate the contact and shipping properties for the selected company name.
a. Configure the auto-complete to call the SetCustomerInformation data transform rule and refresh the
section when the user selects a company name.
i. From the Cell properties Behavior field, click the Display Event Editor icon.
ii. For Event, select On Change and for Action, select Refresh this Section.
iii. In the Data Transform field, select SetCustomerInformation and then click Save.

iv. Save the section.


b. Set the fields on the CompanyProfile section to display as read-only when IsCustomerFound returns a
true result.
i. Return to the CompanyProfile section.
ii. Open the Properties panel for the Contact Name field.
iii. From the Edit Options drop-down list, select Read Only.
iv. In the Read Only Condition field, select IsCustomerFound.
v. Repeat steps 6.c.ii - 6.c.iv for the remaining fields on the section, except the Company Name field.
c. Repeat step 7.b for the ShippingProfile section. Again, do not edit the Properties panel for the Company
Name field.
d. Start a new sales order. Select a company in the Customer ID auto-complete field, and verify that the
contact and shipping information automatically populates and is read-only. Then, enter Joe's Bar and Grill,
and verify that the contact and shipping information does not automatically clear.
8. When the user enters a company name that does not appear in the database, display the message Customer does
not exist; please enter information below., clear the fields on the Company Profile and Shipping Profile tab, and
move the entry to the Company Name field on each tab.
a. Create a report definition named GetCustomerDetails in ABC-FW-SalesOrderFW-Data-Customers. This
report should accept the ID of the company as a parameter, and return the address.
Note: While we automatically populate the fields in the UI, we need a method of automatically clearing them.
We can use a report to return a property that corresponds to the Customer ID; when the report returns zero
results, we'll know to clear the fields.
i. In the Column Name field, select .Address.
ii. In the Rows to Include area, select .CustomerID as the column, in the Relationship field, select Is
Equal and for Value, enter param.CustomerID. Enter Customer ID in the Caption field. In the

32 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Prompt Mode field, select Value Only.

iii. Click the Parameters tab. For Name, enter CustomerID and for Data Type, select Text.

b. Create a declared page named Declare_CustomerDetails, which uses the report definition as a data source,
and refreshes each time you request the page.
i. In the Application Explorer, right-click any class and select New > Technical >Declare Pages.
ii. For Page Name, enter Declare_CustomerDetails.
iii. For Page Class, select Code-Pega-List.
iv. In the Data Source area, select Report Definition.
v. In the Report Definition Class field, select ABC-FW-SalesOrderFW-Data-Customers and then in
the Report Definition field, select GetCustomerDetails.
vi. Click Params and enter pyWorkPage.Customer.CustomerID.
vii. Under Conditional Refresh Strategy, select Refresh per interaction to refresh the page every
time it is requested.

viii. Click the Pages & Classes tab and add an entry for pyWorkPage of class ABC-FW-

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 33
SalesOrderFW-Work-SalesOrder.
ix. Save the rule.
c. Test the declare pages rule.
i. Click the Run icon in the rule form to unit test the rule.
Tip: When called, a declare pages rule creates an XML page of results. Rather than attempt to read
this XML, you can use the Clipboard to view the contents of the page.
ii. Open the Clipboard, and switch to the Standard thread. Expand the Declared Pages node, then
expand the Thread node. Select Declare_CustomerDetails and notice that the SQL statement used
to request the page data appears in the right pane, along with details about the result.

iii. Expand the pxResults node to view the results.


Note: Since we haven't specified a customer ID on pyWorkPage, our report returns all of the
customers in ABC's database. If you do not see multiple results, verify that you have closed any
open sales order tabs.
d. Set the default value of the CompanyNameFound property to true when creating a new sales order.
i. Open the pyDefault data transform defined in ABC-FW-SalesOrderFW-Work-SalesOrder.
ii. Click the Add a row icon to add a new row.
iii. In the Target field, select .CompanyNameFound and then for Source enter "true".

e. Modify the SetCustomerInformation data transform to conditionally set the value of


.CompanyNameFound.
i. Return to the SetCustomerInformation data transform.
ii. Click the Pages & Classes tab.
iii.  For Page Name enter Declare_CustomerDetails.pxResults(1), and for Class select ABC-FW-
SalesOrderFW-Data-Customers.
iv. Add another entry for the page name Declare_CustomerDetails of Class Code-Pega-List.

v. Click the Definition tab.

34 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
vi. Add a new step. In the Action field, select When, and in the Target field, enter Declare_
CustomerDetails.pxResultCount==1. This ensures that PRPC performs the following steps only
when the query returns one result.
vii. Drag the existing Set step below the When step as a child step, and delete the empty Set step.

viii. Right-click the When step and select Add Sibling Below to add a second step to the data
transform. In the Action field, select Otherwise.
ix. In the child step, select .Customer.CompanyNameFound in the Target field, and enter "false" in
the Source field.

f. Create a data transform named RemoveCustomerDetails in the ABC-FW-SalesOrderFW-Data-


Customers class, to clear all of the fields on the CompanyProfile and ShippingProfile sections.
i. Click the New icon in the toolbar.
ii. In the Applies To field, select ABC-FW-SalesOrderFW-Data-Customers.
iii. In the Name field, enter RemoveCustomerDetails.
iv. Click Create.
v. In the first step, select Remove from the Action drop-down list.
vi. In the Target field, select .Address.
vii. Add a new row and repeat steps 7.f.v - 7.f.vi for the remaining properties on the two sections.

viii. Save the data transform.


g. Add a step to the SetCustomerInformation data transform to call the RemoveCustomerDetails data
transform when the customer is not found in the database.
i. Return to the SetCustomerInformation data transform.
ii. Select the child step in the Otherwise, and click the Add a Row icon.
iii. From the Action drop-down, select Update Page.
iv. In the Target field, select .Customer.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 35
v. In the resulting child step, select Apply Data Transform from the Action drop-down, and in the
Target field, select RemoveCustomerDetails.

h. Update the SetCustomerInformation data transform to copy the contents of the auto-complete to the
Company Name field and then clear the auto-complete when the customer ID is not found in the database.
i. Select the Apply Data Transform step and click the Add a Row icon.
ii. From the Action drop-down list, select Set. In the Target field, select .CompanyName, and in the
Source field, select .Customer.CustomerID.
iii. Add a second child step. In this step, from the Action drop-down list, select Remove. In the Target
field, select .CustomerID.

i. Add a free-form layout to the CustomerInformation section, to display the message Customer does not
exist; please enter information below. as red, bolded text. Configure the layout to display only if
.CompanyNameFound is false.

i. From the Layout palette, drag a layout into the section and position it below the Smart Layout.
Configure the layout as a Free Form layout with one column and one row.
ii. Open the properties panel for the cell and in the Value field, enter Customer does not exist. Please
enter information below. Click the Advanced tab and then click the Style Editor icon. In the Style
Editor dialog, for font weight, select bold, and then for color, select red.

iii. In the Properties panel for the layout, in the Visible When field enter
.Customer.CompanyNameFound=false.
iv. Select Run on Client.

36 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
9. Run the process to test for both new and existing customers. In the Customer ID field, type g and select one of the
choices listed. Note that the other fields populate automatically. Now type Joe's Bar and Grill, and notice that
PRPC now clears the fields on the Company Profile and Shipping Profile tabs, and moves your entry to the
Company Name field.

Reference Materials
l PRKB-26378 - Introducing the User Interface Gallery of examples
l PRKB-26245 – How to add tabbed header layouts to sections or harnesses
l PRKB-26377 - How to define the contents of a Declare pages rule using a Report Definition rule
l PRKB-26379 - Introduction to data transforms
l PRKB-26383 - Using a data transform rule in a flow action

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 37
Allow Sales Agents to Select Order Items

Scenario
Sales agents should be able to select multiple products from different product categories and should see the quantity in
stock and unit price for each product selected. Then they will enter a value for the quantity to be ordered for each product
selected.

When the sales agent selects a category the list of products should dynamically change to show only the products that are
in that category.

Tasks
You have been asked to design the Select Order Items work form.

Before starting this exercise, refer to the Select Order Items specification.

Note: This exercise uses activities to implement the specified functionality. Creating activities is a task normally reserved
for Senior System Architects or Lead System Architects.

How To Do It
1. Open the SelectOrderItems section and add the following properties to the data elements defined on the section.
Layout Label Property Control Options
Smart Layout 1 Date Submitted .DateSubmitted pxDateTime Required
Repeat Grid .ItemList Reordering
Row
Numbers
Sorting
Smart Layout 3 Grand Total .GrandTotal pxCurrency Read Only

a. Add the .DateSubmitted property to the form.


i. Open the Properties panel for the Date Submitted field.
ii. In the Property field, select .DateSumbitted.
iii. On the General tab, select Required.
iv. Open the Properties panel for the Date Submitted label.
v. In the Label For field, select .DateSubmitted.
b. Add the .ItemList property to the Grid Repeat layout.
i. Open the Properties panel for the Repeat Grid portion of the Grid Repeat layout.
ii. In theList/Group field, select .ItemList.
iii. On the General tab, select Reordering and Row Numbers.
c. Add the .GrandTotal property to the form.
i. Open the Properties panel for the Grand Total field.
ii. In the Property field, select .GrandTotal.
iii. On the General tab, from the Edit Options drop-down list, select Read Only.
iv. Open the Properties panel for the Grand Total label.
v. In the Label For field, select .GrandTotal.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 39
2. Add the following properties to the Repeat Grid layout.
Label Property Control Read Only
Product ID .ProductID Yes
Category .CategoryName DynamicSelect
Product .ProductID DynamicSelect
Unit Price .UnitPrice Yes
Qty on Hand .UnitsInStock Yes
Qty Requested .QtyRequested pxInteger
Line Total .LineTotal pxCurrency Yes

Note: With a Dynamic Select control, the property used to display the contents of the list need not be the same
property used to store the value of the selection. In this case, the Product list will display the values of
.ProductName, but will store the value of .ProductID. As you configure the control in step 3, note how the control
handles these two properties.
a. Add the .CategoryName, .ProductID and .QtyRequested properties to the Category, Product and Qty
Requested columns. Change the control for the Category and Product fields to DynamicSelect.
b. Add the .ProductID, .UnitPrice, .UnitsInStock, and .LineTotal properties to the Product ID, Unit Price,
Qty on Hand, and Line Total columns.
c. Open the Properties panel for each of the Product ID, Unit Price, and Qty on Hand fields. From the Edit
Options drop-down list, select Read Only.
d. Open the Properties panel for the Line Total field and select the pxCurrency control. From the Edit Options
drop-down list, select Read Only.
3. Configure the Dynamic Select for the Category and Product columns.
a. Create a report definition named BrowseCategories in the ABC-FW-SalesOrderFW-Data-Categories
class. In the Column Name field, select .CategoryName. Run the report to test that it returns the proper
data.
b. Create a report definition named BrowseProducts in the ABC-FW-SalesOrderFW-Data-Product class. The
report should include two columns, .ProductName and .ProductID, and should accept .CategoryName as
the value of a parameter named CatName. Test the report to verify that it filters the products based on the
specified category.
i. Create a new report named BrowseProducts in the ABC-FW-SalesOrderFW-Data-Product class.
ii. Add the .ProductName property to the first column.
iii. Add a second column, and select .ProductID as the column name.
iv. Add the condition .CategoryName is equal to param.CatName.
v. On the Parameters tab, add CatName as a parameter of type Text.

40 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
vi. Run the report. Configure the filter in the Report Viewer to verify that the report reduces the list of
products when you specify a category.
c. Open the Properties panel for the Category field. Next to the Control field, click the Configure Control icon
to open the Parameters panel for the control, and update the configuration using the information in the
following table.
Field Value
Method For Generating Dynamic Select Report Definition
Applies To ABC-FW-SalesOrderFW-Data-Categories
Report Definition BrowseCategories
Select ID CategoryName
Default Caption Select a Category
Property for Option Display CategoryName
Property for Option Value CategoryName
d. Click OK and save the section.
e. Run the process. When you reach the Select Order items screen, add a row and then check that the
Dynamic Select populates with product categories.
Note: Ignore the warning that states that the ProductID property is missing a DS caption. You will fix this
issue in the next step.
f. Return to the SelectOrderItems section, and configure the Dynamic Select control for the Product field
using the information in the following table.
Field Value
Method For Generating Dynamic Select Report Definition
Applies To ABC-FW-SalesOrderFW-Data-Product
Report Definition BrowseProducts
Select ID ProductName
Default Caption Select a Product
Property for Option Display ProductName
Property for Option Value ProductID
Param Name CatName
Select ID CategoryName

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 41
g. Run the process. When you reach the Select Order items screen, verify that the Product Name field
populates correctly. Select an item for the order, enter a quantity, and click Next. Open the Clipboard and
expand the ItemList page under pyWorkPage. Expand ItemList(1), and note which properties on the page
contain data.
4. Create an activity in the Product data class, to populate the ProductName, UnitsInStock and UnitPrice fields
from data in the database. Call this activity as an OnChange event for the Product dynamic select control.
a. In the Application Explorer, right-click any class, and then click New > Technical > Activity.
b. In the Applies To field, select ABC-FW-SalesOrderFW-Data-Product. For Activity Name, enter
GetProductDetails. Click Create to create the rule.
c. In the first step, for Method, enter Obj-Open, and then for Step Page, enter ProductDetails.
d. Click the Expand Method Step icon. For Property Name, select .ProductID and for PropertyValue, enter
Primary.ProductID.
Note: In this step, you use the value you know – .ProductID – to obtain the remaining information about the
product. The Obj-Open method opens the object that matches the given Product ID, and then writes its data
to a clipboard page named ProductDetails. Use of the Primary keyword ensures that you read from the

42 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
correct instance of .ProductID – the instance on the ItemList page list – by setting the context of the
property reference to the page from which the activity was called.

e. Copy the needed values from the ProductDetails page to the calling page of the activity.

i. Click the Append icon to add another step. In the second step, for Method, enter Property-Set, and
then for Step Page, enter ProductDetails.
ii. Click the Expand Method Step icon for the second step.
iii. In the PropertyName field, enter Primary.ProductName , and in the PropertiesValue field, select
.ProductName.
iv. Click Append to add two more rows. Repeat step 4.e.iii to add entries for Primary.UnitPrice and
Primary.UnitsInStock.

f. Delete the ProductDetails page once the activity copies the data from the page.
Best Practice: You should always delete temporary pages from memory once the activity no longer needs
them, to free memory for your application. Pages that are not deleted remain in memory, and in time may
significantly degrade system performance.
i. Add a third step to the activity.
ii. Select the Page-Remove method.
iii. For the Step Page, enter ProductDetails.

g. Return to the SelectOrderItems section. Call the GetProductDetails activity as an On Change event for
the Product dynamic select, and automatically refresh the section to display the queried data.

i. In the Properties panel for the Product Dynamic Select, click the Display Client Event Editor icon
to open the Client Event Editor dialog.
ii. For Event, select On Change.
iii. For Action select Refresh this Section.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 43
iv. For Activity, select GetProductDetails.

v. Click Save to close the Client Event Editor dialog.

vi. Save the section.


5. Create a new sales order to test the category and product selections and verify that the other fields in that row are
populated.
6. Calculate the Line Total and Grand Total values.
a. Create a Declare Expressions rule to calculate .LineTotal, using .ItemList() as the page context. Calculate
the line total using the expression .QtyRequested * .UnitPrice.

i. In the Application Explorer, return to the class group, and expand the .ItemList pagelist. Right-click
LineTotal, and select Define Expression.
ii. Click Create to create the rule and open the rule form.

44 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
iii. Click "expression" next to Value of, and in the resulting text box enter .QtyRequested*.UnitPrice.

iv. Save the rule.


b. Run the process. Select a category and a product and then enter 2 for Qty Requested. Verify that the line
total calculates correctly.
c. Create a Declare Expressions rule to calculate .GrandTotal as the sum of all instances of .LineTotal.
i. Right-click .GrandTotal and select Define Expression. Click Create.
ii. In the Expression, click on Value of to enable the select box and select Sum of.
iii. In the text box next to Sum Of enter .ItemList().LineTotal.

d. Test the expressions by creating a sales order. Run the process and then add multiple products to the order.
7. Create the ValidateItemQty validate rule in the class group, to ensure that the quantity requested is greater than
zero and not more than the units in stock.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 45
a. Right-click ABC-FW-SalesOrderFW-Work and click New > Process > Validate.
b. In the Property field, select .ItemList().QtyRequested.

c. Click Add to open the Validation Conditions dialog.


d. Select Required to ensure that the user enters a value when they create a sales order.
e. For Select a function, select [first number] [relation] [second number].
f. Select the condition as .QtyRequestedIS GREATER THAN.UnitsInStock.
g. In the Message field, enter Insufficient quantity in stock.

h. Click OK to exit the Validation Conditions dialog.


i. Repeat steps 7.b - 7.h to add a second condition that checks if the user enters a quantity less than one and
returns the message Quantity must be greater than zero.

46 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
j. In the SelectOrderItems flow action, click the Action tab. In the Validation Rule field, select
QtyRequested.

k. Create a new sales order and advance to the Select Order Items screen. Select a category and a product,
and attempt to enter a quantity greater than the Qty on Hand value, and then a quantity of zero.

Reference Materials
l PRKB-26404 - How to configure a Dynamic Select Control using a Report Definition rule
l Developer Help - About Validate rules

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 47
Review and Submit Orders

Scenario
Sales agents must review the contents of the customer's order information and also their contact and shipping information
before they submit the sales order for approval. They have the option of going back to edit the order information if needed.

Tasks
You have been asked to implement the Review Order Items work form.

Refer to the Review Order Items specification for details.

How To Do It:
1. Create wrapper sections for CompanyProfile and ShippingProfile in the class group.
a. Open the CompanyProfile section that is defined in ABC-FW-SalesOrderFW-Work.
b. Add a section control and point it to the CompanyProfile defined in the Customers class using .Customer.
i. Drag a section control from the Layout palette.
ii. Select On different object.
iii. In the Using Page field, enter .Customer.
iv. Select the ABC-FW-SalesOrderFW-Data-Customers class.
v. Select the CompanyProfile section.
c. Delete the Smart Layout that exists outside the section include.
d. Repeat steps 1.a - 1.c to add a section control to add a reference to the ShippingProfile section from the
Customers data class.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 49
2. Display the order items repeating grid on the ReviewOrderItems section as a read-only list.
a. Delete the existing section include that references the SelectOrderItems section.
b. From the Layout Palette, add a Repeating Grid layout below the Free Form layout.

c. Open the Properties panel for the Repeat Grid. For List/Group, select .ItemList. On the General tab, clear
the Sorting check box.
d. Add the .ProductID, .CategoryName, .ProductName, .QtyRequested and .LineTotal properties to the
grid, and delete the Add a row and Delete icons.

50 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
e. Open the Properties panel for the entire Grid Layout. On the General tab, for Style, select Spreadsheet.

3.  Save the GrandTotal layout on the SelectOrderItems section as a new section, and add it to the
ReviewOrderItems section below the repeating grid layout.
a. Open the SelectOrderItems section and click the Properties panel of the layout containing the GrandTotal
field.
b. Click the Save As Section icon to save the layout as a section. Enter GrandTotal as the name of the
section.
c. Return to the ReviewOrderItems section, and drag the GrandTotal section below the Grid Repeat layout.
Note: You may need to refresh the Application Explorer to locate the GrandTotal section.
d. Save the section.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 51
Route Sales Orders for Manager Approval

Scenario
Once a sales agent submits a sales order, the application must route the sales order to a manager, who either approves or
rejects the order.

Tasks
You have been asked to design the Manager Reviews Order work form.

Before starting this exercise, refer to the Manager Reviews Order, Approve Sales Order and Reject Sales Order
specifications.

How To Do It
1. Change the section reference on the Approve section to reference the editable SelectOrderItems section instead of
the read-only ReviewOrderItems section.
a. Open the Approve section defined in the class group.
b. Click the Show Wireframes icon.
c. In the properties panel for the section include and in the Use Section field, select SelectOrderItems. Click
OK.
2. Open the ReviewOrderItems section, and save the layout that contains the CompanyProfile and
ShippingProfile sections as a new section named CustomerInfo. Add this layout to the Approve section.
a. Open the ReviewOrderItems section defined in the class group.
b. Click the Show Wireframes icon.
c. Click the free form Layout and then click the Save As Section icon to save the layout as a section, name the
new section as CustomerInfo.
d. Go back to the Approve section and then drag a section control and place it above the existing section
include. In the Purpose field, select CustomerInfo.
3. Change the manager of the TestUnit organization unit to Manager@ABC.com, and change the full name for the
Manager@ABC.com operator ID to Manager@ABC.com.

a.
Open the Organizational Chart gadget ( > Org & Security > Organization > Organizational Chart).
b.
Open the TestUnit organization unit, which is part of the ABC.com organization.
c.
Under Staff, in the Manager field, select Manager@ABC.com. Save the organizational unit.
d.
Open the Manager@ABC.com operator ID. In the Full Name field, enter Manager@ABC.com. Save the
operator ID.
Tip: Your exercise environment contains several users named Manager. Renaming this operator will help
you to identify the correct user for the remainder of this course.
4. Change the organizational unit for Architect@ABC.com to TestUnit, and add the Case Manager portal as a
secondary portal.
a. Open the Architect@ABC.com operator ID.
b. On the Work Settings tab, click Change Organization Unit and select TestUnit under
ABC.com > Sales. Save the operator ID.
c. Click the General tab and then open the primary access group for the Architect@ABC.com operator ID.
d. On the Settings tab, select pyCaseManager as a secondary portal. Save the access group.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 53
5. Route the Review Sales Order assignment to the manager of the TestUnit organizational unit.
a. Open the ManagerReviewsOrder flow.
b. Open the Properties panel for the Review Sales Order assignment.
c. Click the Routing tab, and select ToOrgUnitManager for Router.
d. Save the flow.
6. Log off and log back in as Architect@ABC.com. Run the process and verify that the sales order is routed to the
manager for approval.
7. Open the Case Manager portal. Open one of the assignments pending for Manager@ABC.com, and review the
Approve flow action.
a. From the Run menu, click Open Portal > Case Manager.
b. Under Default WorkGroup, click Manager@ABC.com to view the manager's worklist. Click on any item
in the work list to open it.
c. Review how the Approve screen is rendered.
8. Click Other Actions and select Reject. Enter some text in the Rejection Note field and submit the work item.

54 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Conduct Functional Performance Testing

Scenario
Application performance has to be monitored periodically. Now that you have added rules to your application, it's time to
check on its performance. In this exercise you will review My Alerts and use Performance Analyzer (PAL) to compare the
readings you are about to take with the baseline reading you created at the beginning of the development process.

Tasks
You have been asked to analyze application performance:

l Use My Alerts to determine if there are any performance alerts in the application that you are developing.
l Run PAL to take readings for each step by running the process. Save the readings and compare them with the
readings that you took previously.

How To Do It
1. From the Run menu, click My Alerts to review the listed alerts.
Tip: For best results, log off and log back in to start a new session. Run the process and navigate through all
screens before using My Alerts.
Note: If My Alerts highlights any rule that you created, evaluate the alert code and fix the appropriate rule. If you do
not see any alerts, click All My Sessions to view the alerts that were created for all of the application rules,
including those executed in other sessions. Navigate through all of the pages to see the list and check if any of the
application rules resulted in the creation of an alert.
2. Launch PAL and take readings for each user screen.
3. Once you have finished running through the entire process, use Save Data to save your readings to your desktop.
4. Compare your readings with your preliminary baseline. The counts and times should reflect proportionate increases.
Anything that has changed significantly should be considered suspect and should be researched and fixed.
5. If you make changes, run PAL again and overwrite the files you created in step 3.

Reference Materials
l Developer Help – Working with the My Alerts display
l PRKB-24177 - Interpreting Performance Tool (PAL) outputs

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 55
Create a Work Party

Scenario
A work party allows PRPC to associate a person, organization, or business with a work item. Using a work parties rule
makes many tasks – such as sending notifications and reporting – easier.

Tasks
You have been asked to add a Customer work party to the Sales Order work item. In an later exercise, you will use this
work party to send email correspondence to the customer placing the order.

How To Do It
1. Open the Default work parties rule in the class group and add a Customer work party, using the information in the
following table.
Field Entry
Party Label Customer
Role Customer
Party Class Data-Party-Com
Data Transform Customer

2. Create a data transform to create the Customer work party, using the ContactName and ContactEmail properties
from the sales order.

a. Click the Open icon next to the Data Transform field in your work parties rule.
b. Accept the default values and click Create.
c. On the Pages & Classes tab, add an entry for pyWorkPage. Use the class ABC-FW-SalesOrderFW-
Work-SalesOrder.

d. On the Definition tab, set the .pyWorkPartyUri property to pyWorkPage.Customer.ContactName.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 57
e. Set the .pyEmail1 property to pyWorkPage.Customer.ContactEmail.

f. Save the data transform.


g. Return to the Default work parties rule and save the rule.
3. Add a utility to the StartSalesOrder flow to call the AddWorkObjectParty activity after the sales agent submits the
order but before the manager reviews it. Configure this activity to create the Customer work party, using the
information in the following table.
Note: AddWorkObjectParty is not classified as a Utility activity, so it does not appear in the Rule SmartPrompt in
the Properties panel. You must type AddWorkObjectParty in the Rule field to use the activity.

a. Open the StartSalesOrder process.


b. Add a utility to the flow.
c. Open the Properties panel for the utility.
d. Configure the utility, using the information in the following table.
Field Value
Rule AddWorkObjectParty
PartyRole Customer
PartyClass Data-Party-Com
PartyModel Customer
PartyIDUsed Customer
OutputPageName pyOutput
OutputPageClass Code-ProcessOutput

Remember: You must tab or click out of the Rule field before you can enter the remaining values as
parameters of the activity.

58 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
e. Connect the utility to the process between the Agent Collects Order Info and Manager Reviews Order
subprocesses.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 59
f. Save the flow.
4. Run the process. Submit the sales order for approval, and review the Clipboard to verify that the Customer work
party is created on pyWorkPage.

Reference Materials
l PRKB-26177 – How to automatically add a work party to a work object using the addWorkObjectParty activity

60 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Send Notifications to a Work Party

Scenario
ABC would like to use email to updated their customers regarding the status of their order. This email must include the
order date and the contact information of the individual. If the order is rejected it must include a reason for the rejection.

Tasks
You have been asked to design email correspondence to notify the customer when their order is either approved (see the
Approve Sales Order specification, step 6) or rejected (see the Reject Sales Order specification, step 5).

Additional information can be found in the Application Profile under Order Status Correspondence.

How To Do It
1. Update the OrderStatus correspondence rule, which was created by the Application Accelerator, to notify the
customer by email when their order has been approved.
a. In the Application Explorer, under the class group, expand Process, then Correspondence, and click
OrderStatus to open the rule.
b. In the rule form, enter the text shown in the following example. Note that there are two spaces after "your
order".

c. Add the following properties to the correspondence.


Note: When you add a property using the Add Property dialog, it appears in the correspondence in the format
<<PropertyName>>. Do not type the property name directly into the correspondence editor.
Property Name
.pyResolvedTimestamp
.pyID
.pyStatusWork

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 61
Property Name
.Customer.ContactName
.Customer.CompanyName
.Customer.Address
.Customer.City
.Customer.Region
.Customer.PostalCode
.Customer.Country
.Customer.Phone

i. Position the cursor after "of ".


ii. Click the Add Property icon .
iii. In the Name field, select .pyResolvedTimestamp.
iv. Click Save. Repeat steps 1.c.i - 1.c.iii for each of the remaining properties.

d. Save the correspondence rule.

62 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
2. In the ManagerReviewsOrder flow, modify the NotifyCustomer utility in the Approve Sales Order path to use
the CorrNew activity to send the OrderStatus correspondence to the Customer work party.

3. Create a new correspondence rule named OrderRejected.


a. In the Application Explorer, right-click the class group and select New > Process > Correspondence.
b. In the New Rule dialog, for Correspondence name, enter OrderRejected. For Correspondence Type,
select Email. Click Create.
c. Use the text shown below and the following table for the properties. Click the Add Property icon to insert
properties.
Property Name
.pyResolvedTimestamp
.pyID
.pyStatusWork
.RejectionNote

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 63
4. In the ManagerReviewsOrder flow, configure the Notify Customer in the Reject Sales Order path to use the
CorrNew activity to send the OrderRejected correspondence to the Customer work party.

5. Open the Reject section, and configure the text area to reference the .RejectionNote property, and save the
section.
6. Test your work by completing two sales orders. At the Review Sales Order assignment, approve one and reject
the other. When you approve the sales order, remember to advance the sales order past the Update Inventory
step. Confirm that the appropriate email was sent by the application.
Note: If no email server has been configured, PRPC returns an error after it attempts to send the email. You can
disregard this error, and the additional email attached to the work item notifying you of the failure.
a. In the Review harness, in the Actions menu click Reject to open the Reject screen, enter a rejection note
and then click Submit.
b. Click the Audit link at the top right of the work item window.

64 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
c. In the new window, expand Attachments, then expand Email. Double-click on the email to open the
message.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 65
Review and Select Previous Orders

Scenario
Sales agents must be able to view all completed orders placed by each customer, and select one of these orders as the
basis for a new order.

Tasks
You have been asked to create a form that allows a sales agent to review previous orders from a customer. If an order is
selected, it will be used as the starting point for a new order.

Before starting this exercise, refer to the Review Previous Orders specification.

Note: This exercise uses activities extensively to implement the specified functionality. Creating activities is a task
normally reserved for Senior System Architects or Lead System Architects.

How To Do It
1. Create several approved sales orders for any one customer, to generate data for the previous orders form. Note the
customer you use to place the sales orders.
2. Create a report definition named DisplayPreviousOrders, in the SalesOrder class. Configure this report to return
the order ID, creation date, and grand total for all approved sales orders placed by a specific customer.
a. Create a report definition named DisplayPreviousOrders in ABC-FW-SalesOrder-FW-Work-SalesOrder.
b. In the columns to include area, for Column Name, select .pyID, and then click the Append icon twice to add
two columns. In these columns, select .pxCreateDateTime and .GrandTotal. Update the Column Heading
fields.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 67
c. In the Rows to Include area, for Column, select .pyStatusWork. Click the Select Values icon to select
Resolved-Completed. Click OK.

d. Add a second condition that requires .Customer.CompanyName to be equal to param.CompanyName.

e. On the Parameters tab, enter CompanyName as a parameter of type Text.


f. Save the report.
Tip: When you save the report, PRPC warns you that the properties .GrandTotal and .Customer.CompanyName
are not optimized for reporting. While you can run this report without optimizing these properties, doing so will result
in poor performance, especially as the number of sales orders in the database increases. You should always
optimize application properties before using them in a report.
3. Optimize the properties .Customer.CompanyName and .GrandTotal for the report to improve performance.
a. In the Application Explorer, expand the Property rule category under ABC-FW-SalesOrderFW-Work, and
then the Customer page.

68 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
b. Right-click .CompanyName and select Optimize for Reporting.

c. Accept the defaults and click Next until you reach the third step in the Property Optimization wizard. PRPC
automatically starts two tasks to update the property rule and database schema, and copy the property
values from the BLOB column for existing sales orders.
d. Click Column Population Jobs Dashboard to check the status of these tasks. If they are not complete,
click Refresh All to update their status until they are complete.

e. Once the column population finishes, return to the Property Optimization wizard and click Finish.
f. Repeat steps 3.a - 3.e to optimize the property .GrandTotal.
4. Create a data transform named PastOrder to copy the report results to a temporary page named PastOrders when
the sales agent reaches the Review Previous Orders step.
a. Create a declared page named Declare_PastOrders, populated by the results of the report you created in
step 2.
i. Create a declare pages rule named Declare_PastOrders.
ii. In the Page Class field, select Code-Pega-List.
iii. For the Data Source, select Report Defintion.
iv. For Report Definition Class, select ABC-FW-SalesOrderFW-Work-SalesOrder.
v. For Report Definition, select DisplayPreviousOrders.
vi. Click Params.
vii. In the Value field, enter pyWorkPage.Customer.CompanyName.
viii. Click the Refresh per interaction check box.
ix. Save the rule.
b. Create a data transform named PastOrder to copy the contents of the declared page to a temporary page
named PastOrders.
Note: While you could populate the repeating grid directly from the report definition, doing so limits you to the
Read Only edit mode. Since we want to use the Expand Pane edit mode to display the contents of the

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 69
previous order, we need to copy the report results to a writable page, and use that page as the source of the
list.
i.Create a data transform named PastOrder in the ABC-FW-SalesOrderFW-Work class.
ii.Click the Pages & Classes tab.
iii.In the first row, for Page Name, enter PastOrders. For Class, select Code-Pega-List.
iv. Add a second row, and create an entry for the Declare_PastOrders page of the Code-Pega-List
class.
v. Click the Definition tab.
vi. In the first step, select PastOrders as the Target, and Declare_PastOrders as the Source.
vii. Save the data transform.
c. Add the data transform to the ReviewPreviousOrders flow action, to process before the flow action
executes.
i. Open the ReviewPreviousOrders flow action.
ii. Click the Action tab.
iii. Under BEFORE THIS ACTION, in the Data Transform field, select PastOrder.
iv. Save and close the flow action.
5. Add a repeating grid to the ReviewPreviousOrders section, to display the list of past orders. Use the temporary
page created by the data transform in step 4 as the source of the grid, and add the columns of your report as the
columns of the grid layout.
a. Open the ReviewPreviousOrders section, add a Repeating Grid, and delete the existing Smart Layout.
b. Open the Properties panel for the Repeat Grid. In the List/Group field, enter PastOrders.pxResults.
c. Add .pyID, .GrandTotal, and .pxCreateDateTime to the first three columns. Open the Properties panel and
set the Edit Options for each to Read Only. Enter a label for each column.
d. Delete the Add a row and Delete a row icons.

e. Click the Pages & Classes tab.


f. In the first row, enter PastOrders in the Page Name field, and select Code-Pega-List in the Class field.
g. Add a second row. Enter PastOrders.pxResults in the Page Name field. In the Class field, select the ABC-
FW-SalesOrderFW-Work-SalesOrder class.
6. Add a button to the Repeat Grid layout. Label the button Add to Order. In the PRopertie spanel for the cell click the
Show when active check box, to configure the button to appear only when the row is active.
a. Click the Layout tab.
b. Drag a button from the Basic palette to the right-most column.

70 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
c. Open the Properties panel for the button.
d. Click the Configure Control icon.
e. Under Options, in the Label field, enter Add to Order.
f. Click OK to return to the Properties panel.
g. In the Properties panel, click the Advanced tab.
h. Click the Show when active check box.
i. Click OK to close the Properties panel.

7. Create a new sales order, using the same customer you used in step 1. Verify that the orders you created in step 1
appear on the Review Previous Orders form.
8. Copy the details of the selected previous order to the current order.
a. Create a data transform named CopyToOrder in the class group, to copy the following properties from a page
called PastOrder to the current sales order: .ProductID, .CategoryName, .ProductName, .UnitPrice,
.UnitsInStock, and .QtyRequested.
i. Create the data transform CopyToOrder in ABC-FW-SalesOrderFW-Work.
ii. Click the Pages & Classes tab, and create entries for the following four pages.
Page Name Class
pyWorkPage ABC-FW-SalesOrderFW-Work-SalesOrder
pyWorkPage.ItemList ABC-FW-SalesOrderFW-Data-Product
PastOrder ABC-FW-SalesOrderFW-Work-SalesOrder
PastOrder.ItemList ABC-FW-SalesOrderFW-Data-Product

iii. Return to the Definition tab. In the Action column, select Append and Map to from the drop-down
list. A child row appears below the highlighted step.
iv. In the highlighted step, in the Target field, select pyWorkPage.ItemList. In the Relation column,
select each page in from the drop-down list, and in the Source field, select PastOrder.ItemList.

v. In the child row, select .ProductID in both the Target and Source columns.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 71
vi. Add five more rows to copy the remaining properties (.CategoryName, .ProductName, .UnitPrice,
.UnitsInStock, and .QtyRequested) from the source page to the target page.

vii. Save the data transform.


b. Create an activity named GetSalesOrder in the SalesOrder class. This activity should open the previous
order from the database and call the data transform CopyToOrder to copy contents of the previous order to
the current sales order. Add the activity as the action on the Add to Order button.
Note: To get the entire work object, rather than specific properties, you must write an activity.
i. In the Application Explorer, right-click SalesOrder and select New > Technical > Activity.
ii. In the New Rule dialog, for Activity Name, enter GetSalesOrder.
iii. In the first step, for Method, select Obj-Open to query the work object from the database.
iv. Expand the method and enter the parameter data for the method from the following table.
Parameter Value
OpenClass ABC-FW-SalesOrderFW-Work-SalesOrder
PropertyName .pyID
PropertyValue Primary.pyID
v. Collapse the method and in the Step Page field, enter PastOrder to populate the work item on a
temporary page.

Note: Remember that Primary refers to the context of the activity. Since the activity will be called
from a button in a row of a repeating grid, the context of the activity is a specific row in the repeating
grid, which corresponds to one specific sales order. This ensures that the activity uses the
corresponding .pyID value to open the order and copy it to the temporary page.

72 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
vi. Add a second step to the activity. Select the Apply-DataTransform method. Click the Expand
Method Step icon, and select the CopyToOrder data transform.

vii. Add a third step to the activity, and select the Page-Remove method. In the Step Page field, enter
PastOrder.

viii. On the Pages & Classes tab, add and entry for the PastOrder page.
Page Class
PastOrder ABC-FW-SalesOrderFW-Work-SalesOrder
ix. Save the activity.
c. Configure the Add to Order button to call the activity GetSalesOrder.
i. Return to the ReviewPreviousOrders section.
ii. Open the Properties panel for the Add to Order button, and click the Configure Control icon.
iii. In the Behaviors area, click the Add a Row icon. The Behaviors dialog appears.
iv. From the Event drop-down list, select Click. A menu of actions appears.
v. From the menu of actions, select Advanced > Run Activity.
vi. Select the GetSalesOrder activity you just created.

vii. Click OK to close the Behaviors dialog. Click OK to return to the Properties panel. Click OK to close
the Properties panel.
viii. Save the section.
d. Create a new sales order, specifying the customer you used in step 1. On the Review Previous Orders
screen, click one of the sales orders to verify that the buttons appear. Click Add to Order to copy the order
contents to the current order. Advance to the Select Order Items screen and verify that the order items have
been populated for you.
e. Create a new activity named UpdateOrderInfo to refresh the values of the properties .UnitPrice and
.UnitsInStock from the Product table.
Note: The CopyToOrder data transform currently copies these values from the previous order – information
that could be out-of-date. These columns should be updated with values from the Product table before you
copy them to the sales order.
i. Create the activity UpdateOrderInfo in the ABC-FW-SalesOrderFW-Data-Product data class.
ii. On the Pages & Classes tab, create an entry for a page named Temp.pxResults, using the following
information.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 73
Parameter Value
Page Name Temp.pxResults
Class ABC-FW-SalesOrderFW-Data-Product

iii. Return to the Definition tab.


iv. In the first step, select the Obj-Browse method. Click the Expand Method Step icon. Clear the
GetRowKey check box and the RowKey field, and enter the following paremeter information.
Parameter Value
PageName Temp
ObjClass ABC-FW-SalesOrderFW-Data-Product

v. In the Field field, enter .ProductID. From the Condition drop-down list, select Is Equal. In the
Value field, select Primary.ProductID. This focuses the activity step on the desired product.

74 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
vi. Add two more rows to the method to return values for the .UnitPrice and .UnitsInStock properties.

vii. Add a second step to the activity. In the Method field, select Property-Set. Click the Expand Method
Step icon, and enter the following information.
PropertiesName PropertiesValue
Primary.UnitPrice Temp.pxResults(1).UnitPrice
Primary.UnitsInStock Temp.pxResults(1).UnitsInStock.

viii. Add a third step to the activity. In the Method field, select Page-Remove, and in the Step Page field,
select Temp.

f. Add a step to the GetSalesOrder activity to call the UpdateOrderInfo activity for each item on the
PastOrder page.
i. Return to the GetSalesOrder activity.
ii. Insert a new step between step 1 and step 2.

iii. In the Step Page field, select the PastOrder.ItemList page.


iv. Select the Call method, and press the space bar. With the cursor still in the Method field, select the
UpdateOrderInfo activity you just created.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 75
v. Click the Expand For-Each Step icon. From the drop-down list, select For Each Embedded Page.

vi. Save the updated activity.


g. Start the process, select the customer you used in step 1, and then click Create. You will see the list of
orders previously placed by the customer. Select one order that contains a few items, click Add to Order,
and click Next. Verify that the Select Order Items screen populates with products and quantities.
Note: There is no indicator yet, but the activity now updates the Unit Price and Qty on Hand columns with
current inventory information. To confirm that the activity works as expected, you must first create the
UpdateInventory activity, which occurs in an upcoming exercise.
9. Configure the repeating grid to display the order details for each past order, so that the sales agent can review the
contents of each previous order.
Best Practice: While you could reuse the grid on the SelectOrderItems flow action to display the contents of the
order, the list would be editable. To prevent sales agents from editing the contents of a fulfilled order, you should
create a flow action that displays a similar, read-only list.
a. Create a new flow action named ListPreviousOrders in the ABC-FW-SalesOrderFW-Work class.
b. Change the short description of the flow action to Previous Order.
c. Add a section control and reference a new section named ListPreviousOrders.
d. Click OK to create the section, and edit the section in-place on the flow action.
Tip: If you open both a flow action and the section it references, edit the section, and then save both the flow
action and the section, the rule that you save last will overwrite any changes made on the other rule. For
example, if you add an empty section to a flow action as a reference, open the section rule on a new rule
form to edit it, save the section, and then save the flow action, you would replace the edited section with the
empty one from the flow action rule. To avoid this, remember to refresh the flow action before you edit and
save it.
e. In the ListPreviousOrders section, add a repeating grid to display the ItemList property page. For Edit
Mode select Read Only. Delete the Add a row and Delete icons.
f. Add the Product Name, Unit Price, Qty Requested, and Line Total fields to the repeating grid. Delete the
empty Smart Layout and save the section.
g. Open the ReviewPreviousOrders section, and open the Properties panel for the repeat grid.
h. From the Edit Mode drop-down list, select Expand Pane.
i. Click the Details as read only check box.
j. Click OK to dismiss the Properties panel and save the section.
k. Start the process and select the customer you used in step 1. On the Review Previous Orders screen, select
a previous order and click Review Order to view the contents of the order. Click Add to Order, and
advance to the Select Order Items screen to verify that the contents match the previous order.

Tip: As the number of previous orders increases, your performance may suffer as PRPC generates lengthier lists on the
Review Previous Orders screen. To improve performance when displaying large lists, you can configure the list to load
progressively. To do so, open the Properties panel for the Grid Repeat layout, and on the General tab, select Progressive
from the Paging drop-down list.

Reference Materials
l PRKB-26310 – How to create a Declare Index rule for an embedded property with the Property Optimization tool
l PRKB-26378 - Introducing the User Interface Gallery of examples
l Developer Help - How to reference parts of aggregate properties

76 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Create Sales Order Reports

Scenario
ABC would like to run a report by managers to view the sales orders that have been ordered using the sales order
management application.

Tasks
You have been asked to:

l Create a summary-type report, with a chart, that returns the company name, submission date, ID, grand total, and
status for each order.
l Create a second summary-type report that returns the product, quantity requested, and line total for each item on an
order, and the grand total for the entire order. Use this report as a drill-down report for the first report.

Refer to the Reports and Correspondence requirements in the application profile.

How To Do It
1. Use the Property Optimization wizard to expose the following properties. Verify that each optimization job
completes before you advance to the next property.
Note: Since some of the properties you are optimizing are embedded properties, the Property Optimization wizard
needs to create a declarative index rule for these properties.
Property
.DateSubmitted
.ItemList.LineTotal
.ItemList.ProductName
.ItemList.QtyRequested

a. In the Application Explorer, run the Property Optimization wizard for the .DateSubmitted property.
b. In the Application Explorer, expand ItemList.
c. Right-click LineTotal to optimize the property.
d. In the next screen for RuleSet and version select SalesOrderFW and 01-01-01 respectively. Before you
click Finish, open the Column Population Jobs Dashboard to view the job status. Once the column
population jobs have completed, click Finish.
Note: When you optimize an embedded property, the Property Optimization wizard creates a separate
database table for the corresponding columns, and a declarative index rule to map the table to the page on
which the property is embedded. The wizard cannot optimize a second property on the same embedded
page until it creates or modifies the rules and table used to optimize the first property.
e. Repeat steps 1.c and 1.d for .ItemList.ProductName and .ItemList.QtyRequested.
2. In the ABC-FW-SalesOrderFW-Work class, create a report definition named SalesOrders, which returns the
company name, submission date, ID, grand total, and status for each order.
a. Add .Customer.CompanyName, .DateSubmitted, .pyID, .GrandTotal and .pyStatusWork as columns.
b. For Sort Type on the first three columns, select Lowest to Highest.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 77
c. Enter a Sort Order of 1 in the Date Submitted column, and 2 in the Work ID column.

d. Save the report.


3. If needed, create several sales orders to populate the indexed properties and test the report.
4. Convert the SalesOrders report to a summary report. Group the report data by Company Name and Work Status.
a. Return to the SalesOrder report definition and click Save & Preview.
b. In the Report Viewer window, right-click the Company Name column header and select Summarize this
column.
c. In the Summarize Column Name dialog, group the report by Company Name and Work Status. Click OK.

Note: Grouping the report by one or more columns automatically covers the report to a summary report.
d. Click the Save icon in the Report Viewer to save your changes to the report definition. Click OK in the
popup.
e. Return to the rule form to view your changes.
5. Add a clustered bar chart to the report.

a. Return to the Report Viewer and click the Edit Report icon .
b. Click the Add or Edit Chart icon .

78 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
c. In the Chart Definition dialog, select Bar, then select Clustered.

d. On the Data tab, select both Group By Columns, and select Uniform Minor Group.

e. Click OK.
f. Click the Exit and Run Report icon to view your changes, then save the report.
6. Create a custom drill-down report.
a. Click one of the rows in the report to open the drill-down list-type report.
Note: The columns on this report come from the default drill-down report, pyDefaultReport, which is
identified on the User Interactions tab. A drill-down report is completely different from the report that
references it, so you no longer see the Company Name and Grand Total columns.
b. Click the User Interactions tab on the report definition. In the Custom Drill Down Report field, enter
SODefault. Click the Open icon to create the rule.
c. Add a column for the property .pyID to the report definition. Change the column heading to Order ID.
d. Add columns for the properties ItemList.ProductName, ItemList.QtyRequested, ItemList.LineTotal. Be
sure to use the indexed versions, which you created in step 1.
Note: The indexed versions of these properties are identified by the prefix Index_.
e. Add a column for the property .GrandTotal to the report definition.
f. Click Save & Preview to test this report.
g. Return to the SalesOrders report. Save and preview your report to verify that you drill down to the
SODefault report.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 79
7. Include a clustered column chart on your SODefault report. Title the chart Order Totals by Product.
a. On the report definition, change the function on the GrandTotal column to SUM, and save the report.
b. Click the Include a Chart button and select Column .

c. On the Options tab, verify that Show Slider is enabled.


d. On the Labels tab, enter the title Order Totals by Product.
e. Click OK.
f. Click Save & Preview to run the report.
8. Create a standard report category named Sales Orders.
a. From the Run menu, click Open Portal > Case Manager.
b. Click the My Reports icon to open the Report Browser.
c. Click the New Category icon.
i. For Category Name, enter Sales Orders. Enter the same value for Category Description.
ii. For Category type, select Standard.
9. Return to your report definition in the Designer Studio and add both reports to the new category.
a. Open the SalesOrders report definition, then select Display in Report Browser.
b. For Category select Sales Orders. If the category doesn't appear, refresh the report definition rule.
c. Save the report.
d. Repeat steps 9.a - 9.c for the drill down report.
10. Refresh the Case Manager portal and view each report in the new Sales Orders category.

Reference Materials
l PRKB-26147 - Report Definition rules - Beyond the basics
l PRKB-26095 - Using the Report Viewer to define and evolve simple reports
l Developer Help - Working with the Report Viewer
l PRKB-26098 - Using the Report Browser to organize and manage reports

80 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Conduct Final Performance Testing

Scenario
PRPC captures the performance indicators during the execution of a process. Developers can use the Performance
Analyzer (PAL) tool to analyze these indicators to improve the application performance.

Tasks
You have been asked to analyze the performance of your application (Functional and Performance Testing) by using
Preflight and My Alerts, and by taking PAL readings.

How To Do It

1. Run Preflight by clicking the > Application > Guardrails > Summary. Resolve all the issues that were
found for the rules you have created.
2. From the Run menu, click My Alerts to review the listed alerts. If My Alerts highlights any rule that you created,
evaluate the alert code and fix the appropriate rule.
Best Practice: For the best results, log off and log back in to start a new session, then run the process and navigate
through all the screens, before you review the listed alerts.
3. Launch PAL and take a reading for each user screen. Once you have finished running through the entire process,
use Save Data to save your readings to your desktop.
4. Compare your readings with your previous set of readings. Investigate any anomalous or significantly skewed
readings.
Tip: The counts and times returned in this set of reading should reflect proportionate increases over your previous
readings. Disproportionate changes are suspect and should be researched and fixed.
5. If you make changes, run PAL again and overwrite the files you created.

Reference Materials
l Developer Help – Using the Guardrails tool
l PRKB-25497 - How to download a list of high-priority rule warnings
l Developer Help – Working with the My Alerts display
l PRKB-24177 - Interpreting Performance Tool (PAL) outputs

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 81
Case Management

Scenario
ABC has added a business requirement to the sales order application. The company wants to create a second customer
tier. Customers qualify for this preferred customer tier when they place an order than exceeds $1,000.

ABC would like to offer each premium customer a survey, which they can complete after submitting their order. This
survey must include the contact information for the customer, which can be obtained from the sales order.

Tasks
You have been asked to:

l Create a new covered item, named CustomerSurvey, when a customer's sales order grand total exceeds $1,000.
l Obtain the customer identifier (.pyWorkPartyUri) and email address (.pyEmail1) from the sales order.

How To Do It

1. Open the Case Designer gadget by clicking > Process and Rules > Case Management > Case Designer.

2. Add a new case to the SalesOrder work item.


a. Click +Add Case Type, located above the SalesOrder - Framework item in the Case Designer tree. The
Case Designer dialog appears.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 83
b. In the Name field, enter CustomerSurvey. In the Parent field, select SalesOrder - Framework.

c. Click OK. The CustomerSurvey case type appears indented beneath SalesOrder- Framework.

d. Click Actions, to the right of the SalesOrder - Framework case type. On the menu that appears, click
Open.

e. The pyDefault case type rule opens. Note that the CustomerSurvey class has been added to the Coverable
Work Types list.

84 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
3. Define the condition(s) under which the case will be instantiated.
a. Create a When rule named PremiumCustomer in the class group, with the condition .GrandTotal > 1000.
i. Right-click ABC-FW-SalesOrder-FW-Work, and select New > Decision > When.
ii. In the New Rule dialog, for Name, enter PremiumCustomer. For Condition, enter .GrandTotal >
1000.

iii. Click Quick Create to create the rule.


b. Return to the Case Designer tab. Select the SalesOrder - Framework case, and then click the Details tab.
Click the Edit link to the right of the Instantiation item to open the Case Designer: Instantiation dialog.

c. In the Case Designer: Instantiation dialog, select the PremiumCustomer rule in the Permitted When
field for Manual instantiation, and clear the Automatic instantiation check box.

d. Click OK.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 85
4. Copy user information from the Salesorder work item to the customer survey.
a. Confirm that the SalesOrder - Framework case is still selected on the Case Designer tab.
b. Click the Edit link to the right of the Data Propagation entry on the Details tab to open the Case Designer:
Data Propagation dialog.

c. In the Case Designer: Data Propagation dialog, enter the following properties for both the target
(CustomerSurvey) and the source (SalesOrder - Framework), to provide initial values for the survey.
Set value of To value of
.pyWorkParty(Customer).pyWorkPartyUri .pyWorkParty(Customer).pyWorkPartyUri
.pyWorkParty(Customer).pyEmail1 .pyWorkParty(Customer).pyEmail1

5. Change the icon for the Customer Survey icon.


a. Click the CustomerSurvey case type.

b. Click the Edit link, located to the right of Appearance item.


c. Select a different icon and click OK.

86 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
d. Return to the Case Designer tab and select the CustomerSurvey case type. Verify that the icon to the right
of Appearance has changed to your selection.

6. Test the CustomerSurvey case type.


a. Open the Case Manager portal from the Run menu.
b. Run the process from the New menu.
c. Select a customer, then select products totaling over $1000, and submit the sales order for approval. When
you reach the Review harness, verify that an option appears in the Actions menu to start the survey. If it
does not appear, verify that the order total exceeds $1000.

d. Select Add Work > CustomerSurvey.


e. In the New harness, click Create to create the Customer Survey work item.
f. Open the clipboard and using the Thread page open the tab thread that contains the customer survey work
item. Check that the work party values appear on the clipboard page.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 87
Reference Materials
l PRKB-26368- Introduction to the Case Designer
l PRKB-26369 - Using the Case Manager portal

88 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Submit an Order from the Web

Scenario
ABC wants to allow their customers to place orders from another web application. The order details will be sent to PRPC,
which will create a sales order using this data and then forward the work item to the manager for approval.

Tasks
You have been asked to create a web service to allow an existing customer to submit an order to ABC over the web.

Refer to the Submit Order By Customer specification for further details.

Note: Creating a new process specifically for a web service is beyond the scope of this course. This exercise focuses only
on how to call a process from a web service.

How To Do It
1. Save a new version of the StartSalesOrder flow to create a new starting flow named StartSalesOrderService. This
is the flow that will be called by the service.
a. Delete the shape which calls the AgentCollectsOrderInfo screen flow since this information is provided
through an external interface.
b. Update the short description to Sales Order Created by Service.
2. Use the Service Accelerator to generate the service.

a. Click > Integration > Services > Service Wizard to launch the Service Accelerator.
b. On the Service Purpose step, select the following options.
Field Value
Service Purpose Create and manage work
Service Type SOAP

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 89
c. On the Select Work Properties step, select the SalesOrder work type and the flow you created in step 1.
Enable Create Work, then select the ABC.com organization.

d. On the Select Flow Actions step, do not select any flow actions.
e. On the Customize Service Data step of the wizard, expand CreateNewWork.
f. Under Primary Page Input Properties, enable Use XML for data mapping. Under Primary Page Output
Properties, enable Use XML for data mapping and select .Customer.CompanyName.

90 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
g. Use the default settings for the remainder of the wizard, and then click Finish.

h. Once you have completed the wizard, do not click Done.

Tip: Normally, you would click Done and configure the rules created by the wizard as needed. For the
purposes of this exercise, however, you should keep the wizard open on this page, which allows you to
conveniently access the rules created by the wizard.
3. Configure the CreateNewWorkRequest parse XML rule with default product ID and quantity data for testing.
Note: These default values are added for testing purposes. In a real-world application, you may not want to add
default values.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 91
a. Open the CreateNewWorkRequest Parse XML rule created by the accelerator.
b.  Add the ItemList pagelist property as an element.
i. Select CreateNewWorkRequest, and then click the Add Element icon to add a new element.

ii. Double-click the node (_new_) that is created to enter the details for the node. The Node Name will be
the XML tag. For Node Name, enter ItemList, and in the Context Page field, select .ItemList.

Tip: The Context Page sets the scope for properties on a page or page list. This allows you to more
simply refer to the correct property, just as with a Repeat Grid.
Best Practice: Use the property name (in PRPC) for the tag name. This makes it easier to remember
which XML element maps to a particular property.
iii. Click the Node tab and select Repeating, and then click OK.

92 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
c. Add elements to the ItemList node for the properties ProductID and QtyRequested.
i. Select the ItemList node and click the Add Element icon.
ii. Double-click the _new_ element.
iii. On the Mapping tab, for Property, select .ProductID. In the Node Name field, enter ProductID.

iv. Click the Type tab and for Default Value, enter 61.

v. Repeat steps 3.b.i - 3.b.iv to create the QtyRequested node with a default value of 2.
d. Save the rule.
4. Configure the CreateNewWorkResponse stream XML rule to return the sales order ID for the order created by the
service.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 93
a. Open the CreateNewWorkResponse stream XML rule created by the accelerator.
b. Add a node with the name SalesOrderID, and select pyWorkPage.pyID as the source property.

c. Define a class reference for pyWorkPage on the Pages & Classes tab.
i. Click the Pages & Classes tab.
ii. Click the Append Row icon to add a new row to the Pages & Classes list.
iii. In the Page Name field, enter pyWorkPage.
iv. In the Class field, select ABC-FW-SalesOrderFW-Work-SalesOrder.
d. Save the rule.
5. Create an activity named PopulateOrderDetails to populate the sales order with the customer and product details
and add it to the starting flow called by the service.
a. Create a new activity named PopulateOrderDetails in ABC-FW-SalesOrderFW-Work, which calls the
GetProductDetails activity you previously created for each item on the order.
i. On the Security tab, change the Activity Type to Utility.
ii. In the Step Page field, enter .ItemList.
iii. Click the Expand For-Each step icon located next to the Label text box. In the drop-down select
For Each Embedded Page and then for Valid Classes select ABC-FW-SalesOrderFW-Data-
Product.
Note: Using Expand For-Each repeats this step for each line item on the ItemList page.
iv. In the Method field, enter Call GetProductDetails.

v. Save the activity.


b. Invoke the activity in the flow used by the service.
i. Open the StartSalesOrderService flow.
ii. Add a utility to the flow. Name the utility PopulateOrderDetails.
iii. Open the Properties panel for the utility, and select the PopulateOrderDetails activity.
Tip: Only activities set to either the Notify, Connect, Assign, Route, or Utility activity type can be
referenced directly from a flow shape.

94 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
iv. Position the utility after the Start shape and before the AddWorkObjectParty utility.

6. Deploy the WSDL using the Service Package.


a. Open the ABCFWSalesORderFWWorkSalesOrder service package.
Note: If you closed the Service Accelerator wizard, you can open a service package from the Services

landing page ( > Integration > Services).


b. On the Deployment tab, click Generate Deployment Files.
7. Test the service.
a. Open the createNewWork service rule and run the service.
i. Under the ABC-FW-SalesOrderFW-Work-SalesOrder class, expand the Integration-Services rule
category.
ii. Under the Integration-Services rule category, expand the Service SOAP rule type.
iii. Open the createNewWork service rule, and click the Run icon.
b. Select Supply SOAP Request Envelope.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 95
c. Input the required data directly into the XML in the simulation window. In the CustomerID tag, enter STARB.

d. Click Execute. PRPC returns the test result in a new window. Locate the work item ID (shown in the
Response Parameter Values section – S-34 in this example).

e. Open the Case Manager portal, and in the Default WorkGroup, click Manager@ABC.com to view the
manager's worklist. Click the work item ID that you noted in step 7.d to open the work item. Verify that the
order was placed for Starbucks Coffee, for 2 Sirop d'érable.
Note: When you created the GetProductDetails activity, you did not need to add a step to set the
.CategoryName property, since that value was selected by the user. However, when calling your service,
you do not set the value of this property. As a result, this field appears empty when you open the sales
order. (The remaining properties that appear are either set by the service, or calculated automatically.) To
resolve this, you could add a step to the GetProductDetails activity to populate the .CategoryName activity,
or your web application could supply this information to the application through the WSDL.

Reference Materials
l PRKB-25077 – How to create services with the Service Accelerator
l PRKB-25144 – How to create and execute test cases for SOAP service rules

96 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
Update the Inventory Database

Scenario
When the sales manager approves the order, the inventory needs to be updated with the quantity that was placed in the
order. ABC wants to update the database as soon as the order is approved so that the sales agents will be able to see the
correct number of units in stock.

Tasks
You have been asked to write an activity to update the inventory database table once an order is approved.

Before starting this exercise, refer to the Update Inventory specification.

Note: This exercise uses activities extensively to implement the specified functionality. Creating activities is a task
normally reserved for Senior System Architects or Lead System Architects.

How To Do It
1. Create a new activity named UpdateOrderQuantity in the Product data class, to accept a product ID, open the
corresponding product record in the database, and then update its quantity.
a. Create the UpdateOrderQuantity activity in the ABC-FW-SalesOrderFW-Data-Product data class.
b. In the first step, use the Obj-Open method to open the data record that corresponds to the ProductID on the
sales order, and copy the record to a temporary page called Product.
i. In the first step, in the Method field, select Obj-Open.
ii. Click the Expand Method Step icon.
iii. For OpenClass, select the Product data class.For PropertyName, select .ProductID and in
PropertyValue, enter Primary.ProductID.
iv. Click the Expand Method Step icon again, to collapse the method.
v. In the Step Page field, enter Product.
vi. In the Description field, enter Get product record from database to indicate the purpose of the step.

c. Add an entry for Product on the Pages & Classes tab.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 97
d. Add a second step, and use the Show-Page method to view the contents of the Product step page.Save
the activity.

e. Test the activity.


i. Click the Run button on the tool bar to run the activity.
ii. In the Run Rule dialog, select Create or reset Test Page, and then click Create Page.
Note: Ignore the warning that states that the activity can only be called from another activity. For
now, you just want to verify that each step works property. Eventually, this activity will be called by
another activity.
iii. Open the activity temp page temp_ABC_FW_SalesOrderFW_Data_Product on the Clipboard and
set the ProductID to 32, and update the page.
iv. Return to the Run Rule dialog and click Execute. PRPC presents a window containing the product
information from the database presented in XML form. Verify that the ProductID matches the value
you entered on the Clipboard (32). Note that the units in stock should be 500.

f. Insert a new second step, and use the Property-Set method to reduce the inventory count on the Product
page by the quantity requested on the sales order.
i.Click the Insert icon to add another step before the Show-Page step.
ii.In the Method field, enter Property-Set.
iii.Select Product in the Step Page field.
iv. Expand the method step and in the PropertiesName field, select .UnitsInStock and in the
PropertiesValue field enter .UnitsInStock - Primary.QtyRequested.
v. In the Description field, enter Adjust the inventory count by the current order to indicate the purpose of
the step.

vi. Save the activity.


g. Test the activity.
i. Reset the activity temp page temp_ABC_FW_SalesOrderFW_Data_Product.
ii. Update the temp page on the Clipboard with the same Product ID you used in step 1.e. Add the
property .QtyRequested to the page, and enter a value of 17.

98 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
iii. Click Execute, and verify that the inventory has been reduced by 17, to 483.

h. Delete the Show-Page step, which shows the activity results.


i. Add a third step to use the Obj-Save method to write the Product page back to the database. This will
reduce the inventory in the database by the amount requested on the current sales order.
i. Add a third step to the activity.
ii. In the Method field, select Obj-Save.
iii. For Step Page, select Product.
iv. In the Description field, enter Save the record in the database to indicate what happens in that step.

j. Add a fourth step to delete the Product page.


i. Add a new step.
ii. In the Method field, select Page-Remove.
iii. For Step Page, select Product.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 99
iv. In the Description field, enter Discard the clipboard page to describe the purpose of the step.

2. Create a new activity named UpdateInventory in the class group. Use the Call method to loop through the
UpdateOrderQuantity activity for each item on the order.
a. Create the UpdateInventory activity in the ABC-FW-SalesOrderFW-Work class.
b. In the Step Page field, enter .ItemList.
c. Click the Expand For-Each step icon.
d. In the drop-down list, select For Each Embedded Page, and for Valid Classes select ABC-FW-
SalesOrderFW-Data-Product.
e. In the Method field, select the Call method and the UpdateOrderQuantity activity.

f. On the Security tab, from the Activity Type list, select Connect.
g. Save the activity.
3. Update the ManagerReviewsOrder flow to call this activity from the Update Inventory utility.
a. Open the Properties panel for the Update Inventory shape.
b. In the Rule field, select UpdateInventory.
c. Save the flow.
4. Test the activity.
a. Create a new sales order. Select one product, approve the order, and note the Sales Order ID.
b. Create a second sales order for the same customer. On the Review Previous Orders screen, review the
order you just placed, and note the Qty Requested value. Add the previous order to your current order, and

100 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys
advance to the Select Order Items screen. Verify that the Units In Stock value has decreased by the
amount of the previous order.
Note: Now that you have added an activity to update the inventory in the database, you can verify that the
UpdateOrderInfo activity you created earlier works as expected.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 101
Configure an SLA

Scenario
Service level rules are used to enforce timely processing of the work items that are queued in a work basket or an
operator's worklist. To help enforce compliance, service level rules can execute automated actions to send reminder
notifications, re-route or escalate open assignments, or close an entire item. PRPC provides a Process API that includes
many automated actions that can be called by service level rules to perform these and other tasks.

Tasks
You have been asked to:

l Create a service level rule to automatically reject and close any abandoned sales orders and covered surveys.
l Add the service level to the sales order process.

Review the Sales Order SLA specification for details before starting this exercise.

Note: For the purposes of this exercise, the SLA intervals have been shortened to one and two minutes.

How To Do It
1. Create a new service level rule named ManagerReview in ABC-FW-SalesOrderFW-Work.
a. From the Application Explorer, right-click the class group and select New > Process > Service Level.
b. In the Service Level field, enter ManagerReview.
2. Enter a goal time of 1 minute and goal urgency adjustment of 20.
a. In the Goal area, in the MM field, enter 1.
b. In the Urgency field, enter 20.
3. Enter a deadline time of 2 minutes, and call the API activity pxForceCaseClose as an escalation activity.
Note: The activity pxForceCaseClose is an API activity used to close a work item and its sub-cases.
pxForceCaseClose is one of the activities that make up the Process API, which also includes flows and flow
actions. You can use the APIs tab on the Processes landing page to review all of the elements of the Process API.
To learn more about a specific API element, you can expand the element and review its description, intended
usage, and a list of supported parameters.
a. In the Deadline area, in the MM field, enter 2.
b. In the Escalation Activity field, select pxForceCaseClose.

PRPC: Bootcamp Answer Keys Pegasystems Inc. © 2012 All Rights Reserved 103
4. Configure the activity to update the work item status to "Resolved-Rejected" and add the following audit note to the
work item history: Deleted by the SLA since it has not been processed within the allotted time.
a. Click Configure next to the activity name to open the Params window for the activity.
b. For WorkStatus enter "Resolved-Rejected".
c. Enable the UpdateHistory and Commit options.
d. In the AuditNote field, enter Deleted by the SLA since it has not been processed within the allotted time.

e. Save and close the SLA.


5. Add the SalesOrder SLA to the Review Sales Order assignment in the ManagerReviewsOrder flow.
a. Open the ManagerReviewsOrder flow.
b. Open the Properties panel for the Review Sales Order assignment. In the Service Level field, select
ManagerReview.
c. Save and close the flow.
6. Test that the SLA automatically resolves the work item.
a. Create a sales order. Submit the order to a manager for approval. Note the sales order ID.

b. Click > Process & Rules > Tools > My Work > Work Entered by Me, to open a list of work items
that you have created.
c. Identify the work item that you created and check its status; if the work item is not resolved yet, wait for few
more minutes and click Run to refresh the list.
d. Click on the link to open the work item, then click Review to open the work item. Click the Audit link to
verify that the audit note was written to the work item history.

104 Pegasystems Inc. © 2012 All Rights Reserved PRPC: Bootcamp Answer Keys

Das könnte Ihnen auch gefallen