Automation Anywhere Bot Framework

 RPA | Bot Framework in Automation Anywhere| Automation Anywhere- Part-57

Bot Framework in Automation Anywhere - In this blog we will discuss the framework design that is used to build bots using A2019 Automation Anywhere also known as Automation 360. This blog will cover all aspects related to bot design framework needed to build the bots.

What is Bot Framework?


Bot Framework is a template used in all projects to fit in the best practices in a modular fashion that can be used for logging, exception handling, initialization of the application, to get and process the transactions, reporting and for notifications. The various stages or states involved in Bot framework is as shown in the following figure.

Bot Framework

We will be discussing each of the stages or states in detail one by one which are as follows:-

  • Init Task - In this state we read the configuration file values that are required during the process, also cleaning up of the applications which are opened already.
  • Get Transaction State - In this state we will be taking input from various applications and it could be any application such as excel, website data or from SAP etc. and once we retrieve the data we will be normalizing the input data in a way so that it can be in a structured format.
  • Process Transaction State - In this state we will be using the business rules to process the input data to get the desired results as needed by the clients or the customers.
  • Reporting State - In this state we will be writing the data or maintain the status tracker for each and every processed transaction and once all the transaction status is written then we will be sending the status details to the clients or the customers in the form of email.
Now we will be discussing the example of Bot Framework using A2019 Automation Anywhere. So in this article you will see how to read configuration file values, how to create folder structure, how to read transaction data from the input source application, process the business rules and writing the data to the output application and then send email notification reminder to the customer.

So when you are creating a bot framework consists of two things i.e. one is the master task which would call the sub tasks created in that process. So first of all you would see the designing of the sub tasks and then call those sub-tasks in the master task.

  • Reading Configuration file values sub-task - In this task you have to read values from the configuration file which stores information such as file path, folder path, wait time etc. that would be used through out the entire process. Now you would see the creation of the bot which would read configuration file values for which the steps are given below.
  1. Drag and drop the if condition to check whether the configuration file exists in the required folder location or not. If the file is not present then send the email reminder that file is not present in the required directory location.
  2. If the file is present then drag and drop the open command from the excel advanced package to open the excel file from the required directory location.
  3. Drag and drop the get single cell action from the excel advanced package to get the required cell values.
  4. Repeat step 3 again until all the cell values are being read from the file.
The code snippet for reading of configuration file looks something like this as shown in the image below.

Config Bot Task


  • Folder Structure Creation Task - After reading configuration file values the next step is creation of folder structure. Here in this task you need to create various folders such as Input, Output, Logs, Template etc. which would store the necessary files.
The code snippet for folder structure creation looks something like this as shown in the image below.

Folder Structure Creation Task

Now that the folder structure is created we will now take a look at how to get the input source data in the next stage i.e. "Get Transaction" state. In this state we will be reading the data from the input source and then looping through all the records one by one and processing the records using the process transaction state. So, the process transaction state would also be called in the get transaction state. To update the status call the status task which would update the status for each of the transactions that are being processed.

The code snippet for "Get Transaction", "Process Transaction" and "Status" looks something like this as shown in the image below.

Get Transaction




The code snippet for Process transaction state looks something like this as shown in the image below.

Process Transaction


The code snippet for the status update task or state looks something like this as shown in the image below.

Status Update


So with that we have come to the end of our blog where we discussed about the bot framework that is a must to follow while developing of any business process using Automation Anywhere. 

If you have any queries regarding this blog then you can raise your queries in the comment section and I will resolve all of your queries as soon as possible.

Lastly before we sign off I request everyone of you to provide your feedback after going through the article as the feedback shared by you matters the most.


Comments