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.
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.