Every step in an Activity runs against a page. The Step page setting on the step tells Pega which page that is. Get this wrong and the step reads or writes the wrong data, or fails with a "page not found" error.
The rule of thumb
- If the Step page field is blank, the step runs on the activity's primary page. That is the page the activity was started on, for example
pyWorkPagewhen called from a flow. - If you type a page name, the step runs on that page instead, and every property reference such as
.AmountmeansthatPage.Amount.
Where step pages come from
| Source | Example |
|---|---|
| Created by an earlier step | Page-New makes a page called NewCustomer |
| Loaded from the database | Obj-Open with Step page = CustomerPage |
| Passed in as a parameter | A step page set to a page name held in Param.PageName |
| An item in a list during a loop | Each embedded page when iterating .Items |
A worked example
A bank activity must open a customer record and copy the email address onto the current case.
- Step 1:
Obj-Open-By-Handlewith Step pageCustomerPageand the customer key as a parameter. It loads the customer into a new page calledCustomerPage. - Step 2:
Property-Setwith Step page blank. The primary page is the case, so.Email = CustomerPage.Emailwrites to the case. - Step 3:
Page-RemoveonCustomerPageto clear it from the clipboard.
If you had set the step page of step 2 to CustomerPage by mistake, the email would be copied onto the customer itself, not the case.
Common mistakes
- Leaving the step page blank when the property lives on another page.
- Forgetting that
Param.andLocal.variables are not pages. They do not depend on the step page. - Leaving temporary pages on the clipboard. Remove them with Page-Remove when you finish.
Interview tip
A good answer: "The step page is the page a step operates on. When it is blank, Pega uses the primary page. I set it explicitly when I work with a page I opened, created or looped over." Related: Parameters vs local variables and the Activity label.
good
ReplyDeletegood
ReplyDelete