Robotic Enterprise Framework is a project template based on State Machines.
The Re-Framework has a main. xaml file, which uses the state machine workflow. It is used for a better presentation of the process flow.
The Main.xaml file is designed with the state machine. And it is prepared with the three state activities and 7 Transition. Each state has been connected with the transaction.
Re-framework architecture has four states :
The template contains several pre-made State containers for initializing applications, retrieving input data, processing it, and ending the transaction.
All of these States are connected through multiple Transitions which cover almost every need in a standard automation scenario.
This example demonstrates getting orders from Amazon. This example also explains how to implement Re-Framework for our business requirements.
Open the UiPath Studio home and then select Robotic Enterprise Framework
Create a New Robotic Enterprise Framework
Once it is opened in the UiPath Studio, it looks as shown below. The Re-framework is based on State Machine, and it contains four states as Init, Get Transaction Data, Process Data, and End Process.
Next, click on any of the activities and then click on the Variables pane, you will find some of the global variables which are created by the template itself.
Where Init state which reads all the data from the config file. Go to the Project Pane and then click on the Data you will find the Config file.
Clikc on the Config.xlsx file, Once it is open, it looks as below
Now I am going to add below details in the config file
loginurl is the basic URL instead of the variable, we have created that in our config file, a this will be read from here. And
amazonlogin is the name, however, and if you are connected with assets in orchestrator, then it looks for a name called
amazonlogin; if it is not connected, then it prompts for Userid and logs in.
Output_file is an output file after scraping the data it will take the data to the
output.xlsx and next is the year it will ask the user to which year you want to scrape the data.
Like this, you can create your variables and values directly in the
config.xlsx which can be used throughout your re-framework.
Click on the Init State and then Once the Init state as opened in the UiPath Studio then double click on the if first run-read config file.
Once it is opened, scroll down to Invoke KillAllProcesses.xml and then click on the Open Workflow
Next, the Kill Process activity will be opened as shown below
Add Kill Process activity inside the Kill Process and click on the Kill Process activity and add the process name as
iexplorer in the Properties Pane, as shown below.
Close the Kill Process and then move to the Invoke InitAllApplications workflow
Click on the Open Workflow to Open the Invoke InitAllApplication workflow, Once it is opened, it looks as shown below.
Create a new sequence to work on the browser, I am creating a new sequence called OpenIE_explorer_Example
Once the sequence opened in the UiPath studio, then add Open Browser activity inside the sequence.
Click on the Open browser and then create a new argument in the Argument pane. And then enter the argument type as
System.Collections.Generic.Dictionary<TKey, TValue>and then select the Tkey type as String and TValue type as Object
Next, enter the URL which we are going to get the
amazonurl from excel via
in_config file written as
Next, Open the Amazon login page in the browser and then go to UiPath Studio and add Click activity inside the Do Container of the Open browser.
Next, Click on the Indicate element inside browser and click on the Sign-in button in the amazon login page in the browser.
Next, add one more Type Into activity inside the Do Container and then scrape the Email or phone number page as shown below. Click on the Do Container and create a new variable as
password in the Variables pane
After entering the email or phone number you need to click on the Continue button, for that add Click activity, and then indicate the Continue button on the browser.
Next, add One more Type Secure Text activity and then scrape the Password in the browser and then enter the
password variable under Properties Pane for Secure Text Property and also set the type of the
password variable to
Next, add Click activity and then scrape the Login button on the browser
Once we login to the Amazon we need to order the items, so Add Click activity and then scrape the Order section as shown below.
Add Click activity and then scrape past 6 months button under Orders
Ctrl+F2to select the year from the drop-down
<html app='chrome.exe' title='Your Orders' /> <webctrl tag='A' aaname="+in_config("year").ToString+"/>
in_configthe argument in the argument pane and then enter the path to the file as shown below.
existfilein the Properties Pane for Exists Property.
existfilevariable inside the if Condition and then enter the path of the variable(in_config("output_file").ToString) in the properties pane for path property
So We have completed our initialization part.
Now, let us go to the Get Transaction state. If you see the Transaction variable in the variable, the variable type is of QueueItem.
So here we are not using Orchestrator so we can change the variable type to String.
As soon as you set the Transaction variable type to String you will find many errors across the workflow because it has been passed as QueueItem in many locations.
Double click on the Get Transaction Data
We are not going to assign anything to the string, so these are temporary errors, Just click on the TransactionItem on the End process and cut it then paste it in the same place so the error will go.
Next, click on the Invoke GetTransactionData Workflow and then click on the Open Workflow and then open the Variable pane, and wherever you will find the Transaction variable set the variable type to string.
When you click on the Import Argument on the Invoke GetTransactionData Workflow you need to freshly enter the argument because we have changed the variable type to string.
And even you need to traverse through Try Catch exception and then just cut and paste the Transaction variable after you do not see any errors.
And we still have an error in the Process Transaction, and then click on the Open Workflow under Invoke Process Transaction workflow.
Once you open the workflow, you will find Process Transaction activity, click on the Process Transaction and then open the arguments in the Arguments Pane and then set the In_Transaction argument type to String.
In the same way, traverse through Try Catch and Finally block and set the Transaction variable type to string.
Now we have removed all the errors which occurred in the Workflow. Now go back to the Invoke GetTransactionData Workflow and then comment out the Get TransactionItem activity as shown below.
Next, Go back to the Process Transaction state. Double click to open it. Add Attach Window activity inside the Process Transaction
Next, click on the Indicate window on-screen and then indicate the order history page on the browser.
A state machine is a concept used in designing computer programs or digital logic.
Create a new process called Static_Machine_Examples
In this example, we are considering Lift as a real-time example for Static Machine.
Num_Of_Customersin the Result Property under Properties Pane.