Calling automations from Pega Platform
You can invoke automations from any flow action that runs as part of a standard flow,
modal dialog box, or overlay. The automation identifier assigned to your automation in Pega Robot Studio must be
referenced on the flow action. Automations can be invoked from either a pre-action or
post-action. The decision of where to invoke your automation depends on your business
requirements. Call a preprocessing automation when you want to fetch data from an automated process
to be rendered on the next immediate (or future) UI screen. The preprocessing actions are performed in the order shown on the Flow Action
rule form. Pre-processing actions are performed in the following sequence: Call a post-processing automation when you want to collect information from your user
to use as input in your automation. The following figure shows the post-processing rule form: Post-processing actions are performed in the following sequence: A subset of properties defined on your case is automatically bundled with each
automation invocation request. The exact set of properties to include is governed by the set of relevant property records defined for your case
type. You can change the set properties that are bundled in each automation
request by modifying the relevant records defined for your case type. All fields created in the Case Designer or Data Designer are automatically marked as
relevant. However, relevant records can be curated and modified for your specified case
from the Relevant Records landing page ( Each relevant record property is accompanied by its current clipboard value. Only scalar
properties are included in your invocation request. Page properties, page groups, and
page lists are not supported at this time. After an automation is invoked, the automation uses the case data included in the
request. For example, an automation could use an account number to update a customer account
in a mainframe system. The invoked automation keeps track of the incoming values of all properties. If any of
these values change during execution, the modified values are automatically included in
the response back to your Pega 8 application. Updated property values are automatically
posted back to the clipboard page that your flow action is running against. If an
automation is invoked as a pre-action, the values are posted to the clipboard before the
associated section is rendered. If the automation is invoked as a post-action, the
clipboard is updated as part of the flow action submission process. Depending on the validation criteria defined on your flow actions, your case processing
can halt if an automation returns invalid data. Check your automation logic and ensure
that your automations are returning valid data to your Pega Platform
application. Automation invocation responses include a return code as well as a status message that
reflects the success or failure of the automation. The return statuses are used for
informational purposes and do not affect the processing flow of your Pega Platform application. An automation developer can return one of the
following messages: The automation ran to completion but encountered an error that
might have prevented the successful processing of the intended
automation task. For example, this error can occur if the automation is unable to
look up a specific customer account because of an incorrect
account ID. Actual use of this message is dependent on the automation and
implementation. Communication of these errors to the end user is
handled before the automation is completed by using, for
example, a Windows dialog box or an overlay. However, some error conditions affect your case processing flow. Your Pega Platform application automatically handles environmental errors,
including: If any of these scenarios is detected, a page message that describes the problem is
displayed automatically. The user can do either of these actions: When one of these environmental errors is detected on a postprocessing automation
invocation, the Submit button label changes to Ignore
and continue. The user must decide whether to quit or continue their
workflow. Button labels do not change if an environmental error is detected on a
preprocessing automation invocation. In addition, button labels do not change if the
default case action buttons are overridden by selecting Customize the action section
button labels on your flow action. You can also add custom error-handling logic by specializing the
Preprocessing automations
Post-processing automations
Passing input data to automations
Retrieving output data from automations
Message Description Completed The automation ran to completion and did not encounter any
errors. Completed with errors Did not complete This is the default return status. The automation developer is
required to overwrite this return code on exiting the automation. If
this code is displayed, most likely an error occurred in the
automation that prevented a clean run pyProcessAutomationFailure
extension point activity. For example,
you might want to send an email to your case administrator or technical support team
whenever an automation request fails.
Previous topic Attended automation architecture and design Next topic Automating activities in Robot Studio