UiPath REFramework - The Basics for Beginners (Full Use Case)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
the robotic enterprise framework is a very important concept in uipath it's a template provided by uipath that helps you build your robots and it holds several advantages that is locking scalability reusability and error handling it's also the concept in the advanced stratification from uipath so if you learn uipath reframework you will master the certification as well i will teach you everything about setting the reframework up here so you can start building your own reframework and then in the next two videos i'll help you take the next steps what you will promise me here is that you'll open up your own ui path and you'll build with me don't worry i'll hold your hand and my name is anna jensen let's start building if this is your first time building the uipath 3 framework it can seem a bit overwhelming don't worry i'll hold your hand we will take it as simple as possible and i will take you through all the necessary features and settings of the ui path 3 framework what you need to promise me is to open up uipath and build with me in that way i can teach you everything in this video and you can build your own reframework after this so first we'll need to download the course materials you'll do that by clicking the link in the description below that will give you a folder like this with some data in let's open it so we go to the capital sheet like this and it's three columns id country and capital id is a unique identifier just ranging from one to ten but imagine this could be a much larger excel sheet with a thousand rows then this could be very handy we will actually also use this id when we do locking later on then we have a country we have india germany great britain and so forth and we want to find the capital and we want to find a capital and write it back to this excel sheet this mimic a robot that you will actually build of course it's a simplification but it's very good when we want to understand the reframe work so we will build this process in the re-framework and the first thing that we'll do is to understand the process what's actually going on which systems do we need and then we can set everything up in the reframework let's get started so if i move my excel sheet a little bit over here and i open up uipath studio one thing that we'll need to make sure you have is that you have the modern design experienced enabled so if you go to settings then you go to design then you scroll a little bit down you need to have this use modern for new projects enabled in that way you will start all your projects by the modern design experienced you'll mostly likely have that enabled but it's just to make sure so then we go to start let's create a new process first we'll just create a simple process that explains what's actually going on here and which activities that we want to use so here i can just say ref for reframework and then we'll say understand so this is just to understand what's going on in the process which is always nice you can never build anything if you don't understand what's going on that's why process descriptions are very very important but here we can do fine without i'll take you through so we have this uipath studio open here i'll open up the main workflow what i want to do is of course automate all this i don't want to sit here and do searches and write in the capitals we want our robot to do that so i go back to uipath i want to read this excel sheet into a data table so we can work with it the reason is that data tables are very easy to work with and manipulate and we'll take advantage of that so i go to activities and then in search activities i'll find a read range here under workbook pick the read range the reason we do that is because we don't need to have excel installed we can all do it so over here in read range i'll first need a workbook path it's tempting just to hard code card coding the workbook path let me show you how we do that so if i go over to my file which is in this folder here i can shift right click and then i get access to the copy as path again shift right click to have this copy as path enabled in your right click then i can just click on this i can go back to uipath i can hear control v paste in the path that is bad practice don't do that use variables for things that can change imagine that this file actually get moved then my robot will go down and i need to go in and fix it in the robot it's much more nice to do it with variables because then we can first of all if it changes we can change it here in the variables manager one place and we can reuse it which we'll actually do here so what i want to do i want to go in here i'll delete this then i'll press ctrl k always create your variables in the activities that is easy and you'll make sure that it will create a variable of the correct type here i'll just say str excel path then i press enter now i need to specify which sheet do i want to read and let me show you the excel sheet again i want to read the capital sheet as this is this sheet so i go back to the read range then i say capitals i want to read it all so delete everything that's in here then having this marked i go over here this is the object repository that is open i made a great video about that that will explain you everything here but that's not the topic today so i'll choose the properties here i will in output i will specify which data table i want to output it to again go down here press ctrl k that will create a variable i can just say dt capitals this is just a name i gave it you can give it whatever name you find most describing just choose a name that you can always go back to i like these dt in front because then it describes what variable it is and we can always open variables manager if i go down here and let me enlarge it a bit you can see that we actually have created an str excel path of the variable type string and then the dt capitals of the data table one thing that we'll see is that we missed the default value here so we're using a variable here in this read range but it doesn't hold any value so it will just be empty what we do here is just in the default paste in control v our copy path now it's here and it'll get used up here so remember to do it here then i can close my variables manager so now we read it into a data table we can start working with it to work with it we do a for each row in data table so i'll find a for each row here for each row and data table and drag it in what this does is simply just iterate through each row here in this data table i have a reference that is called q and row i can rename this is just a describing name q and row is good but if you want to say for example like row that was used in the earlier versions of uipath you can do that i'll stick with q and row then i need to specify which data table do i want to iterate through and actually we have the data table that we just created up here so i can start writing dt and then you can see that it actually the intellisense suggests us that we use dt capitals if you don't have the intellisense of say that it will look like this then you can always press control space it will show up i can press tab whenever i am having the right variable that one is here so i say dt capitals so now we are iterating through this data table then we want to do something i really want to open up a browser and do the google searches here with the capital let me show you so if i open up a chrome browser i navigate to google and let me just agree on this and then i can start searching for the capitals for example the india capital over here i can say india and then a space i can say capital press enter and i want to scrape this new daily and i want to scrape it back to excel that is my case today and this is very good because we work in a system that is here in a web browser but it could easily be sales force or whatever system that you want to automate in it also has transactions here we have 10 transactions you can see this as one transaction one transaction one transaction and so forth so we can actually separate them as you can see so we can do this imagine that we can actually do this one day then we can do this the day after and so forth they are independent and the benefit here is that we can use the re-framework because the reframework lets us handle transactions and that is handy when we want to for example say combat arrows say that our say that we now we are making this a process in the ui path and something went wrong here then our robot will stop and everything will be stopped here but with the re-framework it let us automatically restart our process it also locks the arrows so we know what's happened and what we can do afterward if for example some data is wrong let me show you so here first i'll i want to scrape this and let me go back to studio i need a use application browser application browser here and drag it in and first of all i don't want to do it here because what happened here is that will open up a new browser scope every time i have a new row as you can see here that will be india germany great britain so what i want to do is actually to move it outside and then have the for each row in data table inside so if i just do that then you can see here in this use application browser we need to define the scope and that is actually our browser scope so let me just navigate to the front page so we are completely sure that that's where we want to open it so if i just click indicate application to automate here you can see it turns green if you haven't downloaded the edge extension i'll show you how in a few seconds but if it turns green simply just click it and you'll see that it automatically detected google and it has the browser url if you for some reason don't have this the edge extension you can go to home then you can go to tools and download the edge extension here it can also let you download firefox or chrome if you want that let's go back so now i open up google and one thing that i actually also want to do in larsen this a bit is to create a variable of this browser ul it's not really important here because google is google but imagine that you're using a browser that changes we want to do that and we might reuse it so what i can do here again press ctrl k and then i can say str url like this i press enter and then i go down here in variables and fill in the default value so this is also about teaching you some best practices so i hope you really stick to the end of this video remember now to have a quotation mark in the front and in the end like this then i can close my variable manager so now here i open up google and then i iterate through each one of the rows in this data table and that is this excel sheet so now i want to do a google search and i want to do a google search let me minimize this on first india capital so it's a dynamic expression that is the india part with a static part and that will just be the capital so it will look like this where capital will be used for all my searches and this india will change to germany next time and so forth so to do so i'll find a type into if i go back to uipath i'll find a type in to here and i drag it in so now i need to specify where do i want to type something in that will be in this search field so i click indicate an edge here and i click that one here i just click confirm uipath automatically create a selector for for me that is the address of this field that is fine here i can instead of type into input i can rename it a little bit better that's also best practice to rename your activities so they are describing especially say that you your robot breaks and you have an exception this activity will get described and if you have a lot of type into input you don't know whether where it's actually went wrong so if i say here type into and then i can say google search field like this now i just need to say what do i need to type into and i need to type into something into here so if i go down here and here i want to type in india first or germany whatever whatever row we are in i want to iterate to each one of these rows and first to target the current rule i can just reference the cue and row so let me press ctrl space again to have the intellisense here i have the cue and row i just press tab then i say dot then i'll say item that is the header of the column then in parentheses quotation mark i can say country let me spell it right country like this and then since it's an object it comes from this data table i'll say to string so i want to type in the country but also want to type in a space and then capital what i do here is just i press space then the plus and space more and in quotation mark i can type in my string you don't need the spaces here but it makes your expression look a bit more nice so what i want to do that was the space and then just the capital what i also want to do is to either when i'm here i can say india capital i either want to press the search bar search button or simply just press enter to get to this page let me get one back what i can do is to either add a hotkey or to press this drop down and find the enter key but one thing that we'll need to be aware of is that this delete the entire thing that we just wrote so what we will do here is to go here mark this ctrl c copy it then take the drop down you see it got deleted so what we will do is to we will in the front of the k enter we'll press ctrl v that one will paste in our expression then another space a plus and another space here we go so now we have our expression if we want to investigate it we can go over here to properties i go up here to text click the three dots and here we have our expression what this says is that we just want the cue and row that's the row we're iterating through then we want to look in the country column we are converting it to a string since it's just an object for now then we want to search for a space and a capital and then we want to press enter this is all this says and we can click ok now let's just talk about one thing that could be handy so whenever we made a search say for example india capital like this we go to this page as you can see this looks a little bit different at the google front page and one best practice to always do in your robots is that when you handle transactions which which you can see this from then we need to make sure we navigate to the same place so whenever we start a new row we need to be at the same place it might not make a difference here but it might so what i want to do here is that i'll find a go to url here just drag it in the front of this iteration just in the front of the type into and then we have the url we already created up here so i'll just say str url this will just navigate to the google front page every time so we make sure that the front page will look not like this but like this it's a very easy thing to do but it will make sure that your robots always perform the same when they start from the same place it should be very simple so now i can close down my excel sheet here and we can try to run the robot we will encounter one arrow i will show you in a bit so if i close down this edge and run my automation we run our automation by click this drop down up here and then click run file it will open up edge and i will make my india capital germany capital you can see it goes crazy fast canadian capital brazil capital so forth this uipath web automation start debugging this browser is not an error it's just related to the input method that we choose from the type into and it's built in so no worries so now we created the automation well nothing really happened we just did the searches we could try to actually get the text that we want so say that i open up chrome again here we go i can go to google and then i'll say india capital here i want to grab the new daily and what i want to do here is that i go up here and scroll a little bit down and then we want to get this text so what i will do here is that i'll say get text here this one will automatically scrape whatever i choose let me show you so i drag it in here i can indicate it in somewhere so i indicated in the edge here i wanted new delhi here so it turns red that means that we need an anchor so i'll try to think of something that will always be here and close to this new daily well that will be this capital we sometimes have to work a little bit around with these selectors don't worry i'll take the capital here so if i press the capital it turns green and it seems to work it might not work with all the capitals we will debug later on to see if there's something wrong but for now we will choose this anger as this seems reliable there will always be a capital here so it will say germany and then this capital and then we will pick up this capital here then i'll say confirm i now want to save this capital into a variable so i can use it so if i go down here i can press ctrl k again and then i can type something in str capital that will just be my name i gave it so again i will save it here into str capital and i can now display it i could either write it back to excel but let's save that for the re-framework which we will get to in just a few minutes but for now let's display it in the message box that's always good for debugging so i'll find a message box and drag it in here i can say str capital like this and now let's run the automation to see that it actually grabs the capitals that we want if i run the file again it opens up a new edge it says india capital it says new delhi and let me drag in from my other screen new daily that's fine i click ok the automation will continue germany capital and for some reason let me drag in again here it says capital of germany blah blah blah wikipedia it seems that for some reason it grabs this this is not very handy we want the berlin so let's do a bit of debugging we can stop the automation and just fix this this is a nice thing to see that we can work a bit with selectors to actually get our automation working so let's fix it first thing that we'll do is to close down this new delhi here in the background so that doesn't open then we'll click the tree ribbons click edit target so here you can see that it actually it's down here because it's some for somehow find this anchor this is not very good so when you hover your mouse over here click the delete target now choose a new one so we want the berlin and then we want the anchor up here and this seems to work and sometimes it's this is the easy solution when we have to dig deep down into the css css selected that will be another a more advanced solution you can watch the live sessions about the css selectors by clicking the video up here in the right corner but this is not the case we're here to learn about the reframe work so now i just click confirm and again this is to understand my process so let's just close down the edge and try to run our automation again to see that it actually works so here india capital let me go to the other screen it can grab the new delhi but that was not the problem that was the germany so let me click ok here germany capital and drag in from other screen that was berlin great britain capital let me drag in london [Music] canada let me drag in ottawa it seems that our automation work now this is the automation that we will use in the reframework again we did this because it's very important to understand the process when we're automating in the reframework as any other place by jing denmark capital copenhagen poland france capital paris australia capital here we're done our automation work this is the automation that we'll use in the reframework i hope you got a good understanding for what's going on let's start the reframework the reframework is all about queues and transactions so what we will do is to let me open up this excel sheet from the course data again so in capitals i want to upload all these transactions here to the uipath orchestrator the orchestrator is the place where we handle these things you can see that as a queue in your supermarket and then i will add customers to that so each customer is a separate item and at the test we can process each customer separately so for example to the queue i'll add the 1 india then i'll add 2 germany 3 great britain 4 canada five brazil six china seven denmark and so forth and then and only then we can start process processing in them in the reframe work we could either mix these two things into the reframework or as best praxis says we can split them into a dispatcher and a performer so we will have one robot that actually adds the items to the queue and one robot that is the reframework that will process the items we will do such here so let's create a dispatcher dispatcher is just a robot that add items to a orchestrator queue so we will create that so i'll right click here in my studio and open up a new instance this will just create a new process in a few seconds that we can use so let me close this one here and start a new process here i'll say ref this patcher and click enter here we go let me drag it a bit up here and let me maximize a bit further and open the main workflow so what i will do is simply just to replicate what we did before here in this let me let me make sure that we have it over here let me drag it in so what i will do here is that i will still have the read range here and then i will use the browser and instead of just doing these things i'll just add them to the queue but to do so we need to have a queue in orchestrator so we need to have a queue to upload them too first of all let's go to orchestrator so to go to orchestrator we can go to cloud.uipath.com that will have this sign in so sign in with your credentials i'll sign in with mine that will take you to the front page of the automation cloud you can click your tenant here this will be taking this will take you to orchestrator it will look like this so we will first of all i'll create a new folder i like to do that because this is a new project i don't want to mess with my current projects which some of them are my company so i'll go to tenant here then i click folders i click this little plus sign here and here i can just say ref demo i'll choose to have the process package source as tenant package feed then this package that we create can be shared across folders instead of just creating in in this folder so i click create so here we have a ref demo what you want to do is to click it here go to cues and let me just queues here and we can add a queue so this will just create a new queue so i'll add a queue create a new queue what should we call it well we can call it ref demo like this and we'll add it now we can start adding in item to this queue so we go back to our this one was to understand it and we created another one that called dispatcher that is blank let's create it from here so first thing to do is to simply just replicate this step here we will read the excel sheet so what i can do here is that i can control c can control v that will copy it over but since we haven't specified the two variables of this let me open the properties you can see that these two are not declared then we need to do it what we'll do here is that we can just say control k and press enter that one will create the str excel path again here i can mark this press ctrl k press enter that will create a dt capitals but there's nothing in the str excel path if we go down here let's make sure that we do the right thing so shift right click on your excel sheet copy as path go back here to this excel path and paste it in by control v we have it here one thing that we could take advantage of and which we will do is the assets in the uipath orchestrator an asset is just a container for values you can see them as variables at the orchestrator and we want to instead of having this stored here in the variables manager we want to store this path in the uipath orchestrator that is handy because we can share this part across different robots and we can only update it once say that this gets updated and since we are using it in the reframework we will do just so so what you can do here is again delete it from here so it will have a clear value then we go to orchestrator again if you want to go to orchestrator type in cloud uipath.com and login make sure you're in the right folder mine was called ref demo then i'll go to assets i can add an asset here create a new asset we give it a name and i'll just say excel path and then we can give it a value so if i paste it in here you can see that my path get pasted in here just remove the quotation marks we don't need them when storing values into orchestrator so then i click create now i have this one here i can call it from my uipath robots so what i need to do here is that i go back to the dispatcher that we were just building here then i'll go to activities i'll search for a get asset here so if i drag this get asset in this will just get assets from my orchestrator so i need a name and the name was make sure you don't make any mistakes that's always nice so i copy this go back to my dispatcher and in quotation marks paste in the asset name now i need to give it a value and this value is the value that it will have when it gets outputted so it takes on this excel path it will take on this path this value here and we need to store it in a variable and we already create a variable for that that was the str excel path so i'll say str excel path so this will work shouldn't we try it one thing that we need to do is to change the folder down here because we called it ref demo and if you can see yours simply just go over here click refresh this will refresh the folders and resources you can choose it now there's the ref demo so now now we can try to run it just make sure your excel sheet is closed we can try run the file just to see that we can actually pick it up and it works so here we are reading it and nothing really happens so shouldn't we add the rest of it to it so we can actually visible confirm that everything works the easiest thing would just be to have that for each row over here and drag it in i want to iterate through their dt capitals it's still named that so i'll say d t capitals that's it now i just need to add them to the queue and to do that i'll find the add cue item here and drag it in so this one will take each row and add them into our queue that is very handy but we need to have some call properties defined one of them is the queue name so we need to say which queue name do we want to add to and since we created that go to your folder and go to queues we have this queue name here then we go back to our dispatcher again we could create a variable so let's do so ctrl k i can say str cue i'm so bad in spelling cues do you know that then i'll press enter so if i go down to my variables you can see my queue name is here i can paste that in remember to put it in quotation marks doing like this so now we can add to the right queue we are not adding any items to it so if i go up here to the three dots we can start adding in the things that we want and let me just show you what we actually want we want to add the idea that is the unique identifier and then the country so here i can give it a name this will be the name that it will hold in the orchestrator queue so i could for example say id it will be of the type string and now i just need to say what value does it have to be well i want it to be one two three four and to target those we just do as we did before we refer to the queue and row and then instead of referring to the country we'll refer to the id column that will look like this so i'll say cue and row here then i'll say dart item parentheses quotation marks and then i want to refer to the id so i'll say id like this then to string so now i added the idea but also to this same queue item i also need to add the country and that was just the same expression that we had before so i'll say name country and i can either copy it from up here or copy it from the previous studio instance that we have but i will do it up here then i'll say country so now i add my id and country those are the ones that i want to add to my queue items because then we can start processing in the ui path 3 framework robot that we are about to build so that's it let's try to run this we need to need to close down the excel we run this and see inspect that it actually works with our asset and that we can add items to our queue so if i go to orchestrator then i go to my queue you can see here that we have nothing in it and even if i refresh it you will see that it still says zero zero zero but don't let that fool you click the three dots over here click view transactions now you can see we have 10 nice transactions and yeah you guessed it those are ours that we just created so if i click these three dots here i can click view details here we have one of them that is id9 country friends nice but maybe see all of these look like each other i want to be able to identify these q items without having to open each one of them i could add a reference that one is here so to do so let me go back to our dispatcher to do so we can give it a reference again we can just refer to the cue and row and then we can pick the id because that is actually a unique identifier i can easily identify what item it is just by looking at the id number so if i again say q and row then i'll say item parenthesis quotations map quotation mark id then to string like this and let's see that it actually works so if i run my robot again this is a dispatcher this is a very important concept so if you don't understand this this last 10 minutes please rewind the video and make sure you know what's going on before proceeding to the actual performer of the reframework so if i go in here and i can refresh the queue here you can see we have two pages now and now we have a nice reference so for the new queue items we have one two three four five six seven eight nine ten and of course this reference that's number ten let me open it that corresponds to the idea that was the whole purpose of it if you like this video you can really help me a lot if you give it a thumbs up that will help the channel and me thank you now this was a dispatcher let's move on to the uipath v framework performer to see what's going on let's clean a bit up here so let me minimize this minimize this we have our dispatcher here that adds to the queue we have the one we built from the first to understand the process that is here so let's start from the blank when we open up the reframework we will use some of the components that we just built and created but for now let's just right click and open up a new uipath studio this one will be our third one so we have the one where we understood the process we have the dispatcher and now we are going to the performer to start up a ui pathway framework you need to go down here from new from template scroll a little bit down and choose the robotic enterprise framework click that one we can call it something i will call mine ref demo and click create first i will give you an overview of the re-framework tell you about the important concepts and where to find the key settings and then we will create our process let me maximize this so i open up the main workflow let me open up the properties over here again this is the object repository i made a video about that but for now we will open up the properties this is how your uipath reframework will look like when you open it up we have the canvas here this is called a state machine layout and over here in the project we will have our folders here you'll find the main xaml this is this main and you will also find some other workflows if you go inside the framework folder here you can see one called close all applications you can guess what that does then we have process kill all processes and so forth don't worry we will take some of them and some of them we won't even talk about as they are not necessary to set up and understand the reframework they are just advanced concepts which you can find in our advanced udemy course you can find a link to that in the description below as well some of them are very simple some of them we will introduce here in this video and some of them we won't touch let me minimize it again then we have the data folder this is the two folders that we will touch upon in this video and the data folder that holds one thing that we want to talk about that is the config this is an excel sheet with some key config features it's very simple so let's open it i can either double click or here in this project folder or i can find it in my windows path where i store my ui path projects this is how the excel config sheet looks like first of all we need to do one thing before our wii framework can run and that is to specify a queue so here you can see this is just an example queue called process abc queue we need to have our queue name here so what we can do here we created a queue in orchestrator remember so if i go back to orchestrator our queue was named ref demo so i can copy this one ctrl c go back to our reframework that is here sorry go back to the excel sheet and paste it in like this so now we have our queue name value that is all we need to have the reframe going but we can do one other thing in the constants we won't touch anything these settings are fine as they are you can work with them when you want to get more advanced but for now you don't even need to understand them that is part of the things that uipath has set up for us but in the assets here we can specify which assets that we want to get from orchestrator and what name we want to store them into let me show you so if i go back to orchestrator in my assets i have this excel path and i want to use this excel sheet as well here in my reframe work so i mark this and ctrl c go back to this so in here in the asset i just paste in the name i could of course also write it but to make sure that i'm not miss writing anything i will add in the asset here then i can give it a name and to make things very simple i will just give it the same name so what this does it does is in the reframework it will get this asset from orchestrator and then we can use it in the reframic under this name that is all there is to it you can of course add descriptions to it if you want but we will keep it simple so make sure it's saved mine is auto saved up here but make sure it's safe and close it down then go back to the reframework so now we charge the folders and i said you can find the config in the data let me collapse that as well so now let's try to understand what's going on over here it will be a very simple approach that will teach you what's going on and then we will start building as i believe you learn ui part the best in that way so imagine when we click start here on the wii framework we will start up here then we go to the initialization this initialization state as it is we can actually open it so there's actually more into it if i double click it this is what comes up so here you can see that we have a an entry then we have a try catch and all these things that i'm telling you new now don't try to understand those those are not important that will be next steps in your reframing journey journey the things that we're going through today is enough for you to understand the reframework and build within it so we scroll a little bit down and here you can see the invoke init all settings workflow this is an invoked workflow and remember we saw the workflows from over here if i open up the framework i can actually invoke these things by just for example kill all processes i can drag that in now i have an invoked workflow just like this of course we will not do it so i'll delete it again but this init all settings is here we will open up the workflow so we'll read everything from the excel sheet into a dictionary a dictionary consists of key value pairs let me show you if i open up the config sheet again for example one key value pair from our dictionary that we create in the reframework would be this so the key that will be the orchestrator cue name we look that up and then we get a value back that is the ref demo you don't have to worry about this this is done automatically so just relax here and just but you just have to know what's going on so that's what's going on we also list the assets in the config so i can close down the init all settings and we can scroll a little bit down all these things we don't really want to do we can have the kill all processes so usually whenever we start up the re-framework we want to kill all systems or at least close them that we're working in in that way we make sure that we can restart them and don't have to worry that our robot will start in a system that is not properly initialized or in the process in a system where a process is halfway in that means our robot could fail so always close down the systems and open them up again unless you have a reason not to of course so we could actually do it here if i open up the workflow here you can see that it's all empty except the log message that is fine but i want to make sure that my system in this place the edge browser is closed so let me open up the edge browser again that is here and now i go back to uipath and in activities i find a kill so i need to process name of the edge the easiest way to find that is to press ctrl alt delete that will open up the task manager and i want to get the name of the microsoft edge process i can do that by right clicking here then go to properties and this is the name i want to use so if you don't know the process name you can always find it by pressing ctrl alt delete and go find it in here mine was named msh so i copy that one out let me go here and in quotation marks i just pasted in the msh we're doing this because we want to kill the browser i want to close it and then we can open it up to make sure we are on the front page and of course we can easily have an overview of it here but it's very clever when we have more complicated processes so we want to open this one up that's fine so let me just save it to be sure here i can close this one down this was just this invoked process so if i scroll a little bit more down we don't need to to know nothing about this then we need to initialize our applications what applications do we want to work with those ones goes in here so i can open up the workflow that is here again it's nothing we just want to open up the edge so to do so i'll find a use application browser just like we did before when we tried to build the process to understand it so i just put that in here i need to indicate where do i want to automate and let me just you can also copy activities from before but let's just try to understand and to make completely sure let's make sure that we are on the google page here so now i just indicate the application to automate that one will be this edge browser so i click that one that's it and you could also create an asset for this google address i will leave that to you that could be best practice if your url changed a lot or if you reuse it a lot we will let it be here for simplicity now you just know so this one open up the browser what i want to do is to overhear options close i don't want this to close at all time because i'll use it later on in the reframework so over in properties you can click down here you can click to drop down here and then i choose never so now i choose not to close it i will choose to close it whenever my rev framework is done but simply just not here then i want to use this browser instance and this was actually this one i want to use this later in the process and to do so i will store it in a ui element so over here an input output element go up here press ctrl k and here i can give it a prefix ui and then i could call it something i could call it google search or whatever i want to call my browser i could always call i can also call call it edge google search which i think i will do like this so now i started into ui element and if i go down here into variables you can see that it's stored as a ui element but it's only defined here and since this was an invoke process let me save it and let me just go out to the main this was an invoke process that means that it will stay in here to make it come out again here if i open it that will make me go in here then we need to convert it to an argument and to do so we can right click convert to argument an argument can pass in and out true invoke processes like here and since we want to pass this variable the content of that we want to pass it out i will change the direction to out so we it gets created in here we open the browser and then we create this variable and we want to pass that out that's why the direction is out so in arguments remember we created it as a variable then we converted it with the right click and now we can pass it out so then i can save it we will use that argument in a bit so now i can close this because we have to open our browser then we can close it now this turns orange this means that we need to map our argument to a variable here in the main workflow because this was only defined here in this init all applications to do so we go to variables and here we get we can call it something i could call mine ui h i call it google search like this we need to change the variable type to ui element and since it's already up here we can find it here or we could browse for types and find it mind1 is here that is fine so having created that one we can you can see it created as a ui element we just need to change the scope so we need to make sure that it's defined during the whole reframe work so not just here in load configurations so what i'll do here is that i will say general business process that's it now i can map it and relax this is the last thing that we'll do in initialization we'll go back and talk about the reframe work so if i click input arguments here then you can see that uipath automatically said oh well these two names are similar let's map them you should just confirm okay you're not orange anymore you're good we can click save we're done here let's go back to the main so what we did up here we we started here and then we configured the initialization that is we close down our browser and then we open it again after the initialization is done we could we could face after the initialization is done we could face two states we could either say well something went wrong we couldn't open up our system that could be our browser then we will move over here that is the system exception transition i will go over here and end our process and over here that is the last thing that will happen nothing will happen anymore but of course most times we will set up our systems and then we will have this successful here here in this state you don't have to open it you don't have to do anything uipath the reframework template will just automatically get your transaction data and the clever part is that we will uh here in this let me get to the queue we will get each item one by one so we will get the transaction item here one by one and what will happen here is that this transaction get transaction data state will say well do we have another transaction that could either be if the queue were empty then we'll go over here and say no data then we'll end or we could have emptied it say that we processed all our 10 or 20 items then we'll also end up here but if we have something on the queue that we defined we define that in the config sheet remember in the excel sheet then we want to go down here to process the transaction so we will go down here in the process transaction and then we will process the transaction one by one as we get them from up here in our case we will do the google search and we will write back to excel and three things can happen before we go in here and define this we could either have a system exception that could be that our system is down that we couldn't find the browser or whatever system you work in or we could have a success that is everything is fine or a business exception a business exception is for example when something is wrong in the data so nothing about the systems or anything but about the data that we're trying to process that could be if we needed a double and for some reason we got a string in and we couldn't calculate on it then we will have a business exception let's figure out how to use the process transaction because now we have a better understanding of the entire reframework so if i open the process transaction again we have a lot of things here we can see we have an invoke process workflow we have a transaction status the only thing that we will touch is the invoke process workflow so if i open up the workflow here it's empty so we want to process our queue items and let's look at the queue items so if i click the three dots here i click the view details our queue items is we have an idea and we have a country we want to process those and we want to find the capital but first let's just see that we can actually process them by simply just writing them out to a right line we will do nothing else so we go back to uipath and then we find the right line i'll drag it in here to target our transaction item that is that was the one that we go here into main that was the one that came from up here and moved down here now we know that we have a transaction and we have only one as we process them one by one then we can target them here and uipath automatically rename those to in transaction item and you can see this by if we move here by doing this and then here in the in invoke process workflow we can see in the import arguments that this in transaction item is having the value a transaction item and that was the one that came from this state up here again you don't have to understand these just have knowledge about it because later on in the more advanced lessons of this re-framework we'll work with that but now we go to process and here we can just write in transaction item to refer to the transaction item this is just a generic term we need to say what do we want out of this transaction item and since we want the country out and we know you can see the country sorry there was this browser the country is here we have that in our transaction item we just need to refer to this country here and let me go back to here so in transaction item then we say dot specific content like this quotation marks and parentheses and then we will say country like this and again we need to convert it to a string like this so now we are actually having our reframe work we have used the config sheet and we are getting the items from the queue and we start processing them just to the right line but this will just show us that it actually worked and it also shows that we can kill the chrome and open it up again so now we will just see that we can actually process each item in a red line we will not process it in a browser but we can figure that it will kill the edge and it will open it up again again nothing happened so just a simple one to see that we actually have set up the reframework and we can process each item so if i go down here i can run the workflow it closes down edge it opens it again well nothing really happens here it runs there you go we finished our v framework well as you see the only thing success you saw was that it closed down edge and it opened it again but what happened was if we go to output you can see the log here you can see we have some killing processes that was our state here now we start processing the item process transaction item number one india that was the country 2 germany 3 great britain and so forth and we actually had a double because we added it twice to the queue so you'll see india comes down here in 11 again and so forth so now we can process item in the reframe congratulations you have understood the real framework or at least you can build a processes in it the rest is just to fill in our process so we can actually make sure that we can do these google searches with it but for now you have actually built your own reframic process and you have used the config sheet but let's finish it that would be nice wouldn't it and again if you haven't liked the video it will help me a lot if you press thumbs up to it thank you so now let me close this what i want to do here is that i want because i open up the edge i want to get this edge browser here in the process transaction and do the google search so let me open up the process transaction and again invoke process workflow open that one so we have it here first of all i'll need to use a use application browser you can find it over here in recent we just used it or if you didn't then just use the search and search for use application browser let's drag it in here i need to either indicate the application to automate or use an input element since i want to use the ui element that we just created from the initialization mine will go here in the input element so if i go up here and then press ctrl k i can again say ui then i call it edge google search like this now this gets created as a variable but we need to go down to variables here and since this variable is coming from outside we'll convert it to an argument again so i'll right click convert to argument now we have it here in the argument and this direction is right it's coming from outside in we are taking it from the main and getting it in here that is in and i can click save if i go to main again you can see that this invoke process workflow has now turned orange i can click import arguments here uipath automatically have mapped it that happens when you are giving him the same name or almost the same name then then this happens in case it's not you just need to map in yourself it's very easy just make sure you map them to the right name with the right value then i click ok i go back to process so now we are actually using this ui element from up here we're using that here so now we know we're in the right browser what do we want to do we want to do the exact same things at with this as we did before so why don't we just copy it or remake it but here i want to go to a url i can easily copy that one over here paste it in here and since we haven't created this url this time and again we could create either a variable or we can actually store them in orchestrator if we wanted i'll leave that to you i'll just hard-coding it in for now so i'll just taking this google.com and do this and of course we need to have them in quotation marks like this don't worry these small corrections you'll make all the time as an rpa developer i mean i when i build these reframe works in my job i'll usually make a lot of mistakes or not mistakes but i'll have a lot of corrections to fix that's rba developer live don't worry so now we're going to the google com we can start doing the searches and to repeat to make sure that you will understand this i will do it from the beginning but if you're lazy you can copying in here from the beginning so first and let me just show you we want to have a type into then to get text and we will not store it into a message box but an excel sheet so we will find a type into here and drag it in so after the go to url and here we need to indicate it again so i click here mine is here and then we click confirm so and again we need to rename the activity so we can say google search field what do we need to type in well we can use this one down here that was the country but since we know that the inter deleted our text we can start by putting that one in so now we have the enter we can add in the things that we want to make it more simple to look at click the tree dot here this is the enter but we want something in front of it and something is down here but let me just rewrite it so we get it into your head and i'm sure it'll it's already there but let me repeat it so i'm sure you understand it i'm so glad that you are here and when you understand this reframe work this will be a blessing to you you will have a very easy time to pass the uipath advanced certification and you will have a very easy time to get a job so in here i'll say in transaction item let me just have a space just to have a little bit more space then i'll say dot space oh and now here you can see that we actually should have the intellisense on so we don't make these mistakes they now have dot and i'll say specific content parentheses quotation marks country quotation mark parentheses to string then i'll say i want the country and i'll say plus space quotation mark space capital yeah it's uh you can just i'll leave it a bit here so just copy this one in or write it in actually and then click ok so now we're doing the google search we're taking that from the same expression that we did before here we know that we can get the country here from each process so now now we just need to get the text and the easiest thing and since we we only work with the selectors if you want to see to work with selectors you can go back in the video and see how we did here otherwise just take this copy it go over here and paste it in down here since we haven't defined this variable we will just declare it so i'll press ctrl k sdr capital like this there's no image available that is fine we will get the text from the correct field we define the selector you can find it by going up here and target if you want and you can see the selector here devices selector and the selector and the window selector that is fine so we store it into sdr capital now we just need to write it back to excel but now the logging part come in since we only have a mesh queue items we have for example this 10 australia we can't really write it back to the queue items because the queue items will get processed nothing will go in there we will need to update the excel sheet that's where we keep the log so again let me open up the excel sheet so i want to write my log here that will be the capital in this case i want to write it in here i could either write it into the capital sheet or create a new sheet that is just not to overwrite the initial data if we want to use it again it will be the same but for now i will create a new sheet that is fine to do so the easy thing would be to read this excel sheet in the initialization of the reframework and since we got the id we can do a simple lookup we can also look up the country but the unique idea we know is unique and we will look that up and write the result back in the corresponding row so what we want to do we go back to the read framework and let me just save it close this one and let me just save it for all time sec then we click main we go to an analyticization we just want to read the excel sheet here in the reframework we haven't done so so let me just go down here just below the internal application we will create a sequence or we can just drag in the activity but i sometimes like to create sequences to have a better understanding what's going on here i'll just say create data table of countries and capitals and here i can have in the read range so in activities find a read range then i drag it in the workbook path and now the clever thing comes in because we stored this workbook path in our config sheet let me save it let me go to project just to show you here in the config here we store it as excel path so now we can use it we use it from orchestrator because we stored it early on so and actually it's this one i know it's the same here but just to make sure we are referring to this name so i'll take the excel path from here and to refer to that to the config sheet i can go here and then i can press ctrl space again i can say config and then i can say parentheses and in quotation mark i can have my name then i have to string so this one will get the asset called excel path it will take the value from orchestrator if i close this one down again i go out here to assets it will give us this value and this is the value of our excel sheet pretty clever huh so if i go back here so now i got this so where do i want to read i want to read from the capitals sheet as you can see here capitals i will delete everything here and then in data table i'll press ctrl k i'll say dt countries i'll just call it that that's fine one thing that i will do is that i'll make sure that this is defined everywhere in the reframework so i can use it in my other state i go down to variables again ibm dt countries change the scope to general business process that's it now i can click save again so if i go to main i have now created a data table here with the excel with the excel data i want to use that in process transactions so i can write the result back to excel or write the result back to the data table and then over here in end process we'll write to the excel sheet so if i go in here process again take the invo process workflow here and now we got this str capital we can write that back to excel first i need to make sure where to write it to so i'll use a lookup so i'll find a lookup here and take the lookup data table since it's a data table that we're looking up to then i'll drag it down here first thing that we'll do is that we want to specify which data table to look up in and that one can be done either here or over here in properties i prefer the properties here because then we can take it upside down so if i go over here we will look up the data table that we just created the easiest thing to do again is to create an argument in here and we could do it by the approach by ctrl k creating it here as a variable and then converting it to argument map it or we can simply just go to argument here i will create it here and call it dt countries the argument type that will be of the type data table as it is a data table the direction will be in and out as from each transaction item we will write values to this data table that is the new capital to that country so the direction will be in and out this time you'll learn a lot about arguments as well in this video so make sure it sticks otherwise rewind the video a bit so now we have an in and out i can save it again i'm always saving a bit too much but uh yeah previous damage and then i can go to main now you can see this turns orange so if i click this import arguments you can see that this dt countries got mapped to dt countries i can just click ok everything is fine let's build on the process so now we can we have a data table to look up in that will be the dt countries the lookup value that will be the idea from the transaction item and to get that that is again in transaction item and let me go down here you can click the three dots here to make it easier to look at so in transaction item specific content like this parentheses quotations marks id and then to string so what we do here is that we take the id from the queue item and then look up in the excel sheet and say which row is this one in so we're looking this value up what column do we need to look in well we have the column name and that one must call id so like this now we just need a row index to say which row is the current id present for example say that we are at number six china then we want to look up the id6 and then it says it's in this row so we want to get the row index back so if i go over here i just press ctrl k i'll say int index like this this one will give us an integer that is a whole number that is the number of the row that we want to write to then we can drag in an assign and what i want to do here is that i want to write to my data table that i just created so i press ctrl space it was called dt countries like this then i'll say rows then parentheses and now i want right to the row that i just found that is the index so control space again take this a couple of times to find out what's going on if you can't so now i have to write row then i just need the column so that is item parentheses quotation marks and since we are writing to the capital column now so we are looking up one rule we found it here we know we're here we want to write to the capital column so i go back here capital what value do we want to write to that capital column we want to write the str capital like this so now we have written it but so this one will write to our data table over and over in our reframe work but we will write it back to excel as well so let me save this and go domain so if i go outside to main we will do it in the end process so if i open this one here this one will close all applications we you can easily fill in your closed edge but we will not do it for now but this is an exercise for you so what i will do here is that i'll find the right range on the workbook drag it in here the workbook path again we have it in the config sheet so i can just say control space say config like this and i'll say parentheses quotation marks and in case i forgot what it was named i can open up the config sheet again which i i think i was named i named it excel path right yeah copy this one here this is just a good exercise to see where we can actually find the values so i take the value from here this was an orchestrator asset go back here then in the config i say excel path then i'll say tostring like this so now we have the excel path then we just need to say which sheet do we want to write to i want to write to a sheet called results like this then i want to write from the starting cell a1 that was actually fine i usually delete it unless i have a reason to add to a specific cell then we need to say which data table do we want to write to well we had this dt countries like this we want to write that data table to this excel sheet that is fine now you just need to add the headers here well done you have now completed another step in your reframe journey but shouldn't we see that it actually worked i'm very excited so we go down here we close this one here and we run the reframework before we do that we actually need to make sure that we have something on the queue because we processed all our items you can see that by going to the queue going in here and view transactions you can see here that this is processed successfully it says status successful we processed all our items so what we need to do is to add more to the queue go down to your dispatcher and just run it again make sure your excel sheet is closed run it and there you go we have 10 more items on the queue so if i refresh this you'll see that it says let me go to the front page here it says new new new new reference one to ten fine we can start processing in our wii framework so let me so we start the process here it closed down edge and it starts writing new delhi india capital and then it will take the next one germany capital take the next one great britain fine and it will take the 10 next ones and then we are done it has hopefully written to our excel sheet if you want the next uipath reframework lessons make sure you subscribe to this channel as we will go through every aspects of the reframe work that's it let's visit our excel sheet so i go to the data so the capitals will be uncharged that is fine if i go to results i have my nice capitals here that's fine or so forth it is fine let's say that we want to do some error handling let's go back one thing that we can actually also improve that that is in this use application here in our process we had in the arguments we have this ui edge google search that means that we only have this ui element going in but we change it slightly and that means we should pass it out again so we can pass it in and out so we make sure we charge the right ui element it's not a problem here but it could be so change the direction here to in and out that will get us a more stable automation so i'll click save here and i go to the main that also means that we need to map it again so i go to process transaction and here import arguments you will see that this is now an in and out argument that is fine i click ok so then i can click save before we move to error handling that is the last step then if you have any questions or comments please post them below here in the comments if you have questions of more general character or to other ui path problems you're very welcome at my discord where we are now more than 1800 rpa developers let's go back and fix the error handling in our way framework let's look at error handling here in our reframework first we'll implement an error in our process and we'll do that in the data so an in arrow in data that will be a business exception so let me show you so if i delete this denmark here and just leave a blank country you can see that a blank country shouldn't hold a capital and we want to tell the user that there's something going on here because let me make sure i saved it i closed this one down let me add 10 items to the queue by the dispatcher here i'll do that now we have 10 items to process and i can run my reframework and let me show what's going on i'll run the file and i'll speed up the start of it where we just found the normal capitals until we reached the exception let me show you and here we have the plane capital what will happen now is that uipath reframing or the robot will look for this capital anchor it can find it so we can't really get the text out of it it will wait 30 seconds because that's the default timeout and then it will give us a system exception but that is really not what we want nothing is wrong with the systems here you can see the browser is working so what the reframework does is that it open up another browser and try the next item and give us a system exception so we want to create a business exception because something is wrong with the data now you can see it tries again and it obviously can let us finish it and let us create a business rule exception out of this let me close this one down if i can here there you go so let's fix it and instead of we don't want a system exception we want a business exception and we can actually also go to orchestrator and here let me just refresh this one here and if i go in here to view transactions we can see here we have an application arrow that is and a system exception we have an error in our application that's not what we want so let's try to fix that to fix it we need to go to process transaction and then we want to go to the invoke process workflow here let's scroll a little bit down so the exception happens here when we try to get the capital and we can't or rather uipath can but you know what i mean so what we want to do is to implement a try catch and let me just move this lookup data table in front of this get text because we want to use this row index let me go to the properties the one that we created here the int index we want to use that here and to handle exceptions we'll need a try catch if you haven't watched my full guide you can click it up here in the right corner that will teach you everything about the tricast this will just be a mini course but i'll find a try catch and let me tell you what a try catch does so try cats it tries something and if that goes right it will just continue to the next activity but if that goes wrong it will go into the catch section that is very handy because that's what we need now so we'll place this get text in here and then we'll say if something goes wrong like you just saw then we want to go and actually go to the cat and we want to handle for that here we can say which kind of exceptions should we catch for and i want to catch everyone so i'll take the system exception that will catch every access exception possible and then it opens this and we can do activities in here first thing that i want i want to write my excel sheet so i'll find an assign here and drag it in we will actually be using this very assign you could copy that or you can just copy whatever inside the left one here and place it up here because we will write to the same cell now we will just give a log message so what do we want to say i'll end in over here i can say in quotation mark and say country doesn't exist or is blank you could of course also make more to rough checks to check whether it's blank or doesn't exist here it's good we just group these two things there you go so now we have this assigned but we actually want this process to stop here and take the next item we don't want to let it go true so we want to throw a business rule exception what we do here is that we'll go over here again you can watch my guide with tri-cats and trolls that will teach you everything about tries and intros try catches and trolls so here we have a troll so what i will do is that i'll click the three dots over here and then create the exception so what i will do here is that i'll say new business rule exception this will throw a business rule exception that is when something is wrong with our data and then in parentheses quotation marks i can have my message so this one will go into the orchestrator we can also create logs from that that will be our next video so be sure to subscribe to the channel so right now it will just be handy to have the same message as we have in the excel sheet so i'll just say country doesn't x exist or is blank like this and then i just click ok and then this one will control here and it will be taken to the nearest if there's any surrounding try catch around this you can see that there's nothing here but if we go to the main you can see that this actually this invoke process workflow is surrounded by another tricast so that one will decide what will happen now the exception will get transferred here and eventually it will go here to this transition and saying that if there is a business rule exception it will be taken to this right here so now we created the try catch and we can start our process so let's add something to the queue let's add 10 new items so i run the file here here and we can run the re-framework to see that our error handling works so i run the file here we go we started it here we have our error we could have lowered the the time that it will take to get this get text before it throws an exception we should have lowered the seconds a bit but that's okay 30 seconds is fine now you'll see that it will not open a new browser because it will recognize that this is a business rule exception and it will just continue will wait a few seconds more there you go now we continue in the same browser window so that was one thing now we should see if our log message in excel works so if i go back to my folder i open the data here we chose to write over and you can see that we got our nice lock message here country doesn't exist or is blank and if we go to orchestrator here and let me refresh the queue there you go now we got a business exception here instead of the application exception you can also see that it's failed and if i go in here view details you can see that there's a log message reason country doesn't exist or is blank there you go you can now do error handling in the ui pathway framework you are ready to stand on your own legs and i think you should watch this video about the object repository that is a very important concept in uipath that will teach you reusability and scalability thanks for watching
Info
Channel: Anders Jensen
Views: 44,992
Rating: undefined out of 5
Keywords: anders jensen, uipath, uipath reframework, uipath reframework beginner, uipath reframework use case, uipath reframework project, uipath reframework basics, uipath ref, uipath reframework - everything explained, uipath re framework dispatcher, uipath reframework example, uipath re framework with queue, uipath re framework tutorial, uipath ref framework, uipath dispatcher and performer example, uipath dispatcher reframework, uipath dispatcher and performer architecture
Id: IoOlteexUcQ
Channel Id: undefined
Length: 83min 18sec (4998 seconds)
Published: Mon Feb 21 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.