What is a step page what role does it play in an activity?

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 pyWorkPage when called from a flow.
  • If you type a page name, the step runs on that page instead, and every property reference such as .Amount means thatPage.Amount.

Where step pages come from

SourceExample
Created by an earlier stepPage-New makes a page called NewCustomer
Loaded from the databaseObj-Open with Step page = CustomerPage
Passed in as a parameterA step page set to a page name held in Param.PageName
An item in a list during a loopEach 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.

  1. Step 1: Obj-Open-By-Handle with Step page CustomerPage and the customer key as a parameter. It loads the customer into a new page called CustomerPage.
  2. Step 2: Property-Set with Step page blank. The primary page is the case, so .Email = CustomerPage.Email writes to the case.
  3. Step 3: Page-Remove on CustomerPage to 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. and Local. 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.

2 comments: