Professional Documents
Culture Documents
Building Resilient Bots - Step List
Building Resilient Bots - Step List
Building Resilient Bots - Step List
This course provides the steps to build a resilient bot using the principles and best practices that
automates a process. This is done using Automation Anywhere Enterprise A2019, a premium Robotic
Process Automation (RPA) platform from Automation Anywhere, which allows enterprises to deploy
a digital workforce comprised of software bots that will automate business processes end to end.
Introduction
This demo will help you to create a resilient bot that is designed to handle unpredictable adverse
situations that occur during run time.
Objective
In this use case, you will learn how to handle errors arising out of unpredictable issues using the
Try/Catch/Finally/Throw actions, and thereby build resilience.
Prerequisites
You need access to the following:
• Access to the Automation Anywhere Community Edition:
https://community.cloud.automationanywhere.digital/
• Access to http://rpademo.automationanywhere.com/newuserlist.php
Note: After editing actions, make sure you click the Apply button to apply the changes and Save button
to save the task bot.
1. Open the file and mitigate any potential issues using the Try action
a. Open the file and mitigate any potential issues.
I. From the Actions panel, drag and drop the Try action to the bot editor.
II. From the Actions panel, drag and drop the Excel advanced: Open action within the Try
action.
III. In the Action details panel, click Desktop file and enter the excel file path with name,
that contains the extracted data.
Note: At all such instances, you will have the option to either enter the file path
manually or browse and select the required file. You can choose either of the two.
IV. Open the file in a read-write mode and select the Sheet contains a header checkbox.
V. Click Apply.
3. Log the status into a log file using the Finally action.
a. Log the status into a log file
i. From the Actions panel, drag and drop the Finally action to the bot editor and place it
parallel to the Catch action.
ii. From the Actions panel, drag and drop the Log to file action at the end of the Finally
action.
iii. In the File path field, enter the file path with name to place the log text file.
iv. In the Enter text to log field, enter the text to be logged in the log text file.
v. Under the When logging section, select the Append to existing log file option.
vi. Click Apply.
1
4. Capture the exact error using the Throw action.
a. Create a child bot to find the error
i. In the Child bot, drag and drop the If condition from Actions panel.
ii. In the Condition field, select the File exists condition from the list.
iii. In the File path field, enter the file path that needs to be searched.
iv. From the Actions panel, drag and drop the CSV/TXT: Open action within the If action.
iv.1) In the File path field, enter the same file path name that was searched.
iv.2) Choose the Comma delimiter.
iv.3) Click Apply.
v. From the Actions panel, drag and drop the Excel advanced: Open action within the If
action.
v.1) In the File path field, enter the file path.
v.2) Open the file in a Read-write mode and select the Sheet contains a header
checkbox.
v.3) Click Apply.
vi. From the Actions panel, drag and drop the Loop action at the end.
vi.1) In the Iterator field, select For each row in CSV/TXT iteration type from the list.
vi.2) In Assign the current row to this variable field, create and select the variable.
Note: Make sure that the variable is created with the variable type as Record.
vi.3) Click Apply.
vii. From the Actions panel, drag and drop the Excel advanced: Set cell action within the
Loop action.
vii.1) Select Active cell option.
vii.2) In the Cell value field, select the existing record variable.
vii.3) Click Apply.
viii. From the Actions panel, drag and drop the Excel advanced: Go to cell action within
the Loop action.
viii.1) Select the Active cell option and choose the One cell below from the drop-down
list.
viii.2) Click Apply.
ix. From the Actions panel, drag and drop the Else condition parallel to the If condition.
x. From the Actions panel, drag and drop the Throw action within the Else condition.
x.1) In the Please enter exception message (optional) field, enter the error message
to be displayed.
x.2) In the Exceptions field, select AllErrors exception from the drop-down list.
x.3) Click Apply.
c. Handle the errors thrown from the child bot inside the Catch action
i. From the Actions panel, drag and drop the Catch action to the bot editor and place it
parallel to the Try action.
i.1) In the Action details panel, select AllErrors exception from the drop-down list.
2
i.2) In the Assign exception message to (optional) field, create and select a variable.
Note: Make sure that the variable is created with the variable type as String.
i.3) Click Apply.
ii. From the Actions panel, drag and drop the Delay action within the Catch action.
ii.1) In the Delay field, enter the delay time in seconds.
ii.2) Select the Seconds radio button under Time unit section.
ii.3) Click Apply.
iii. From the Actions panel, drag and drop String: Assign action to the end.
iii.1) In the Select the source string variable(s)/value field, enter the required value.
iii.2) In the Select the destination string variable field, assign the existing variable to
the output.
Note: Make sure that the variable is already created with the variable type as String.
iii.3) Click Apply.
iv. From the Actions panel, drag and drop Screen: Capture desktop action to the end.
iv.1) In the File path to save image field, enter the file path to save the images.
iv.2) Click Apply.
Now, you have successfully created a task bot to capture a table data with built-in resilience using the
Try/Catch/Finally/Throw actions.
3
Building Resilient Bots to Handle Known Exceptions Using the If/Else Conditions
Introduction
This demo will help you to create a resilient bot designed to handle known exceptions that occur
during run time.
Objectives
In this use case, you will learn how to use the If/Else conditions to build resilience into the bots to
handle known errors.
Prerequisites
You need access to the following:
• Access to the Automation Anywhere Community Edition:
https://community.cloud.automationanywhere.digital/
• Access to http://rpademo.automationanywhere.com/newuserlist.php
Note: After editing actions, make sure you click the Apply button to apply the changes and Save button
to save the task bot.
4
1. Setup the condition to check if the window exists using the If block.
a. Launch the website
i. From the action panel, drag and drop the Launch website to the bot editor.
ii. In URL field, enter the URL.
iii. In Browser field, select the browser from drop down list.
Note: For the purpose of this activity, we will use Internet Explorer.
iv. Click Apply.
2. Setup the screen capture for the failed condition using the Else block.
a. Log the else text into a file inside the Else action
i. From the Actions panel, drag and drop Else condition Parallel to If condition.
5
ii. From the Actions panel, drag and drop the Log to file action within the Else condition.
iii. In the File path field, enter the same file path to log the text.
iv. In the Enter text to log field, enter the text to be logged in the file.
v. Check the Append timestamp checkbox.
vi. Click Apply.
6
g. Set the current read value
i. From the Actions panel, drag and drop the Excel advanced: Set cell action within the
Loop action.
ii. Select the Active cell radio button.
iii. In the Cell value field, create and assign the variable to the output.
Note: Make sure that the variable is already created with the variable type as Any.
iv. Click Apply.
You have successfully set up the If/Else conditions for your task bot. Your bot is now resilient.