Skip to main content
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded. Click here to continue your progress in the latest version.

Pre- and post-processing in Flow Actions

Pre- and post-processing in flow actions

Sometimes you need to perform a set-up or wrap-up action in conjunction with a flow action. For example, you may need to initialize items in a list or copy data from one property to another. To satisfy these needs, you can add pre-processing and post-processing actions to a flow action.

Consider a trip case type example. TGB hosts an annual meeting for employees and vendors. TGB employees use the trip case type to finalize travel arrangements for all business trips. Approximately 60 percent of the processed trip cases are for the annual company meeting. TGB's application requirements include creating a default event for the annual company meeting. Default values populate the event form at rendering. If the user removes the default event, the event values do not populate again. The case type must also be suitable for all company travel requests.

You can use a data transform to populate the annual company meeting on the event form as a pre-processing action. The first time a user opens the form, the data transform populates the event on the form. Creation of the default event occurs when the user selects the flow action or occurs automatically if the flow action is the default action for the assignment.

Note: When you configure a flow action with a pre-processing action, Pega performs the action whenever a user selects the flow action as well as each time the user is presented with the assignment. In the use case for a trip case type, if the user completes the assignment and later returns to the assignment — for example, to update the details of their trip — the event repopulates on the form. For this reason, add logic to a pre-processing data transform or activity to test whether to perform the action.
Data transform pre processing

Another common use case for post-processing is when the billing address of a customer is also the shipping address. A data transform copies the property values from the billing address page to the shipping address page when a box is selected. You add the data transform to the flow action as a post-processing action. When the user submits the form, the application copies the contents of the billing address page to the shipping address page.

When you configure a flow action with a post-processing action, Pega performs the action each time you perform the action. In the previous example of a billing address, each time the user submits the billing address form, Pega performs the post-processing action to copy the billing address to the shipping address.

Tip: Verify that adding an action to the flow action is the best way to perform the action. For example, when configuring concatenation of a user's first and last names, consider using a declare expression. The concatenation is only performed when needed with a declare expression. With a pre- or post-processing on the flow action, the concatenation is performed every time.

This Topic is available in the following Module:

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice