0% found this document useful (0 votes)
22 views7 pages

DeclarativeProcessing 5

The goal seek pattern is used to determine the value of a single dependent property by working backwards through expressions. It prompts users to input missing values. For example, to calculate total order cost, it would ask for line item quantity, then unit price, then discount type to determine the values in each expression step-by-step. Pega provides standard flow actions that implement goal seek by prompting for missing property values. Developers can customize these actions as needed when the standard actions do not meet requirements. Goal seek provides a simple way to gather needed data values without building complex screens.

Uploaded by

mansurshaik1980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views7 pages

DeclarativeProcessing 5

The goal seek pattern is used to determine the value of a single dependent property by working backwards through expressions. It prompts users to input missing values. For example, to calculate total order cost, it would ask for line item quantity, then unit price, then discount type to determine the values in each expression step-by-step. Pega provides standard flow actions that implement goal seek by prompting for missing property values. Developers can customize these actions as needed when the standard actions do not meet requirements. Goal seek provides a simple way to gather needed data values without building complex screens.

Uploaded by

mansurshaik1980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

T abbed Navigation for Screen Flow T ake Lesson

Goal Seek Pattern


This pattern is used to ultimately calculate or determine the value for a single decision. For example, the price of a quote or
the acceptance of a submission. This property is the “goal” in goal seek. The pattern uses backward chaining expressions to
determine what values are missing to determine the goal. For each value that is not available the system can prompt the user
for its value. This is the seek part of goal seek.

Goal seek pattern is useful when we need to seek values for one of these dependent properties. For example, assume we are
calculating the expression which uses discount and if it does not have a value, so the total price does not get calculated. The
pattern utilizes backward chaining expressions to determine what values are missing to determine the goal. For each value
that is not available the system can prompt the user for its value or we can procedurally provide a value.

Pega 7 provides two standard flow actions, VerifyProperty and VerifyPropertyWithListing, as examples of goal seek. We
need to add the flow action in the flow either as a connector action or on a control such as a button.

The system is adaptive enough to prompt users only on properties that do not have values, so for example it can ask them to
enter values for Discount, if discount does not have value. We can configure what appears as the label using the short
description field.

Let’s explain the implementation of this pattern using an example where we look at determining the value for the total actual
cost of an order. These are the list of properties that we are using for this example.

https://academy.pega.com/...Frame=pyWorkPage&pzPrimaryPageName=pyWorkPage&pzTransactionId=3901c0197a345ada3e9f2fad51488bd9[4/29/2015 3:33:45 PM]


T abbed Navigation for Screen Flow T ake Lesson

Let’s look at the expressions, the total actual cost which uses two other properties; LineItemTotalPrice and Discount.

https://academy.pega.com/...Frame=pyWorkPage&pzPrimaryPageName=pyWorkPage&pzTransactionId=3901c0197a345ada3e9f2fad51488bd9[4/29/2015 3:33:45 PM]


T abbed Navigation for Screen Flow T ake Lesson

Both these properties use declare expressions to get their values. LineItemTotalPrice is a product of Quantity and Unit Price.

Whereas discount uses a decision table for its calculation

and the decision table is configured as shown below.

After defining the properties and expressions, the next step is to include the standard flow action VerifyPropertyWithListing.
For the demonstration purposes, we created a sample flow with just this flow action followed by another flow action to
display the result.

https://academy.pega.com/...Frame=pyWorkPage&pzPrimaryPageName=pyWorkPage&pzTransactionId=3901c0197a345ada3e9f2fad51488bd9[4/29/2015 3:33:45 PM]


T abbed Navigation for Screen Flow T ake Lesson

The standard flow action VerifyPropertyWithListing has to be modified to change the goal seek property in both pre and
post actions.

https://academy.pega.com/...Frame=pyWorkPage&pzPrimaryPageName=pyWorkPage&pzTransactionId=3901c0197a345ada3e9f2fad51488bd9[4/29/2015 3:33:45 PM]


T abbed Navigation for Screen Flow T ake Lesson

Now that we have set up all these rules, if we run the flow we will get the following output:

The highlighted text comes from the short description of the property, so if we look at the expression, the total actual cost
requires LineItemTotalPrice and discount. The system first attempts to calculate the lineitemtotalprice and if we look at the
expression it requires quantity and unit price. The system requests the value for the quantity first. Once we enter the
quantity and click submit, it the system then requests the value for unitprice.

Entering the unit price calculates the item total and the system goes back to seek for the value for discount. The discount
uses the table and it asks for customer type.

https://academy.pega.com/...Frame=pyWorkPage&pzPrimaryPageName=pyWorkPage&pzTransactionId=3901c0197a345ada3e9f2fad51488bd9[4/29/2015 3:33:45 PM]


T abbed Navigation for Screen Flow T ake Lesson

When we use one of the standard flow actions for the goal seek pattern, the runtime screen presented to users displays the
value entered in the short description field. It makes sense to set the short description of all other fields that are involved in
the calculation. In most cases the requirements dictate if we could use the standard flow action itself or if we need any
additional customization.

In summary, explore what’s under the covers of the goal seek pattern as it helps to further understand the rules engine by
looking at the flow action rule itself and the activity it uses. Note, that the flow action had a warning, because the standard
flow action uses a deprecated rule type.

https://academy.pega.com/...Frame=pyWorkPage&pzPrimaryPageName=pyWorkPage&pzTransactionId=3901c0197a345ada3e9f2fad51488bd9[4/29/2015 3:33:45 PM]


T abbed Navigation for Screen Flow T ake Lesson

Keep goal seek in mind the next time you find yourself manually creating a screen that feels like a questionnaire or that is
duplicating logic already in trees and tables. Goal seek is simple to use, so experiment with it and see if it fits your
applications needs.

https://academy.pega.com/...Frame=pyWorkPage&pzPrimaryPageName=pyWorkPage&pzTransactionId=3901c0197a345ada3e9f2fad51488bd9[4/29/2015 3:33:45 PM]

You might also like