UiPath State Machines | Full Course to Learn UiPath State Machines

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
dear friends welcome back to automate with Rakesh now we have covered our very first Topic in the series Advanced UI automation now we will get on to Advanced control flow in this topic describe the components of State machine this is one of the area and when they should be used in projects okay when you should use State machine build projects using State machine so basically this will be more around your state machine topic now if you go to academy which course should you search for First you type State machine in under the course okay in the academy course State machine now here you find three different ones at the moment now this one which is of 2022 do10 on which our exam would appear right our exam is of 2000 now here you find that if you go through this particular course in the main page I have already enrolled while enrolling you'll be able to find um the overview let me show you here you can see this course was built using 2022 do10 product version of UA studio and is applicable for newer versions as well so our exam is based on this 2022 do10 right so this is the appropriate topic you may pick now let me resume the course and I'm going to go through through the very first Topic in state machine around the layouts what are the different layouts we have in uipath and when they should be used so this is very important let's go through this there there are a couple of questions also given here we will discuss now here the question is which layout you should pick on a given situation okay that is the question that kind of a question would be framed around this particular paragraph So basically these are three different different structures we have uipath provides three diagrams for structuring workflow files and integrating activities these are sequence flowchart and state machine now sequence there's a entire big paragraph now what is very important I'm going to tell you sequences exhibit a straight forward linear representation this word linear representation is very important you might get a word saying linear representation which one you should pick sequence flowchart or state maion then you would say sequence when you see this word linear linear means what following seamlessly from top to bottom okay this is also another word top to bottom this keywords are very important making them ideal for uncomplicated scenarios so complicated means it'll be another out of these two right we will see that now uncomplicated scenarios this is also one of the the keyword where activities flow follow a sequential order such as procedural workflows and this is a bit of description given for example in UI automation tasks involving stepbystep navigation and typing sequences particularly useful their ease of assembly and comprehension makes them preferred layout for the majority of the workflows now which layout let's say there is a project where a linear representation is required or it is a it is UN complicated project you have to follow a top to bottom approach then which sequence you should follow then you would say uh I mean which layout you will follow you will say sequence got it these are the couple of important words that I've highlighted for you let's move on to flowchart flowchart provide a enhanced flexibility in connecting activities and present workflows in a visually appealing two-dimensional format okay now this could be a keyword two-dimensional format their free form nature makes them well suited for display decision points in a process so if you have to deploy decision points which should be the ideal one then you would say flowchart however caution must be exercised as the use of arrows that can point anywhere May assemble unstructured goto programming let's say you have seen a workflow right you can connect this points everywhere so it can become slightly unstructured uh while you're design potentially leading a chaotic inter waving of activities especially in a larger workflow so caution has to be exercise that's all the point is is all about the most important aspect of flowchart is that unlike sequences they present multiple branching logical operators so this word is important okay multiple branch ing logical operator logical operator means you are having this decision flow decision right flow decision activity hope you know this this one flow decision activity so you can put some logical operators that is all about multiple branching logical operator this is a keyword this enables you to create complex business process so complex business process is also another keyword so in sequence what was the keyword UNC complicated scenarios right for complex business processes flowchart is more idle and connect activities in multiple ways flowchart tend to use so you see the example of a flowchart you see the example of a sequence how it sequence means top to bottom so these are the words linear top to bottom uncomplicated flowchart means two-dimensional format decision points in a process multiple branching logical operators complex business processes okay okay so these are the keywords on which a question can be framed now let's move on to State machine State machine some processes are better expressed as interconnected states which are executed again and again whenever necessary a set of activities are performed in each state and then condition is evaluated to determine what state to transition so the word transition wherever you see remember think of State machine like your framework goes through transitions right from one state to another state so that time anytime this what transition comes you should select state machine for example uh State machine with a minimum States idle xess granted so they have given an example if you're using a access card to bypass a gate right so you put a access card your access card is valid then it will grant you so all of this example has been given so this is State machine okay I'll go through the state machine activities in detail but this is just a layout which layout to select in which situation so when it comes to transition you go for State machine when it comes to a complex business process multiple logical operator right if you see this points decision points in a process two Dimension format you go with flowchart sequences linear top to bottom uncomplicated okay these are the couple of keywords you should remember now let's here they have framed few questions let's see how many of you can answer this layout that represent multiple branching logical operator so I said when you see multiple branching the word branching logical operator comes me you should look for flow decision just now I covered right flowchart multiple branching logical operator so this should be your answer should be flowchart now if I click on submit this is correct now let's see next question the layout in uapa studio that enables a more compact representation of logic and is suitable for standard high level process diagrams of transactional so when you see transactional I told you right when you see this one transition transaction and all that so if you see that word then which one you should select state machine transactions right so this should be you hit on submit this is the right one now let's move on so these are the two couple of questions they had so you got to know how to answer these questions now let's move on I'm going to create a question around this topics I'll put it in different different ways and see if you could answer them all right so let's move on to the question section in this we are going to go through the layout diagram questions on Advanced control workflow so let's see some of the questions question number one which statement about sequences in uip path is not true and I would highly recommend everyone to start commenting the right answer for the question please do participate that would help you to sharpen your knowledge which statement about sequences in uath is not true now look at the questions in when you get this kind of questions not true or true you need to be very careful so not true means you have to see which is the incorrect one option A sequences are ideal for stepbystep workflows and linear data entry process they provide straightforward linear representation for easy comprehension C sequences are incapable of handling error handling mechanism within an automation D the offer an uncomplicated top to bottom flow suitable for procedure workflow now these are the sentences written now let me know which is the right answer first of all I will explain so take your time please do pause the video and comment your answer I hope you have commented the answer let's see what is the right answer and why so here the right answer is sequences are incapable of handling error is that true it is not true the first option sequences are ideal for stepbystep workflows and linear data entry process which is absolutely true in this you can see for sequences linear and step by step workflow this is the right option now look at the option b they provide a straightforward linear representation of for easy comprehension this is also right option D they offer an uncomplicated top to bottom flow suitable for procedural workflows here you can see the word uncomplicated right there you go for a sequence so here you can very well know why C is wrong if you focus on this word it proves advantages in implementing it it is actually good when it comes to error handling right it has advantages it's so the sentence is completely wrong when it said they offer an uncomp this one sequence are incapable of handling so this is completely wrong so your right answer is C now let's move on to our second question which statement about flowcharts in uip paath is not true so it's talking about flowchart which is not true flowcharts are well sued for workflows with multiple decision points due to their free from structure B they allow for enhanced flexibility in connecting activities and present workflows visually flow charts are similar to sequences and offer a linear represent presentation of process D flowcharts enable the creation of complex business processes through multiple branching logical operators now take your time and please do participate do comment what is the right answer for this question now the right answer for this question is flowcharts are similar to sequences no and offer a linear representation this this is wrong now let's look at other sentences are they right for example a flow charts are well suited for workflows with multiple decision points so here the keyword is multiple decision points if you come to the flowchart here you find multiple branching logical operators that mean decision points right so this is one of the area looking at the option b they allow for enhanced flexibility in connecting activities and present worklow visually so here if you read the sentence flow charts provide enhanced flexibility right you get flexibility in connecting activities and present workflows in a visually appealing so you can see how I'm highlighting the keywords which becomes quite easy to remember these keywords and when question comes we can easily determine which is the right and wrong so you got this enhanced flexibility right uh visually workflows visually okay now option D flow charts enable the creation of complex business processes through multiple branching logical operators we saw this word now it is talking about about complex businesses so if you again see here there's a word called this enables you to create complex business processes and connect activities in multiple ways okay these are the important keyword complex business processes you can use it for so here you know why the C answer is a true not a true statement now let's move on to our question number three which statement is not true about State machines in uip paath so please do participate again comment for this question AB c d a state machines allow for design of event driven processes based on finite number of states in transition so it's talk about finite number so always remember to identify that keyword B they are switchable for high level project Organization for complex for complex and continuous processes C State maion present interconnected States executed sequentially with no branching logic D they are commonly used in R RPA framework like the robotic Enterprise framework I framework okay so now tell me which one of these are or correct and which one is the wrong one so please do participate do comment it is required for you to really participate in all these question answer sessions that I have presented in the series so do let me know what is the right answer okay so I hope you have got the right right answer and you have commented so let's see the right answer for this is State machines present interconnected States executed sequentially with no branching log so this is incorrect statement now other statements are right so it is talking about executed sequentially no it State machines will have branching right so this is not right now option a state machines allow for the design of event driven processes based on finite number of states now if you come to State machine here you can find it some of the process are better expressed in interconnected States interconnected States so all the states are interconnected okay like arok which are executed again and again whenever necessary a set of like the uh the process State get transaction State you know runs again and again a set of activities are performed um so here our um keyword was finite number now look at for the finite number if you do a crl f and you should find that okay so here it is uh in studio State machine workflows layout lets you design event driven processes based on a finite number of state and transition finite mean limited know you have a specific number of states defined number of states okay so you got to know why that statement is correct moving on to the second one they are suitable for high level project Organization for complex and continuous processes now this complex and continuous process where do you get it now if you look at the same area this layout should be used for high level project organization see look at it these words are important and complex and continuous processes complex and continuous processes getting it so this is one area now they are commonly used now you must be knowing if you have used AR framework State mission is the main topic or Main component for ramework we are going to learn on Advanced control flow in your exam you will get lot of questions from Advanced control flow now what is Advanced control flow here are two subtopics given for you describe the component of State machines that means this topic is around State machines and when they should be used in projects build projects us using State machine so we have to learn around State machine in detail now let me show you in Academy if you go to the courses and then search for State machine here you would find some three different courses at the moment on state machine now which one to go for the state machion in Studio 1 hour 25 minutes which I see if I click on this this and then click on overview I see this course was built using 2022 do10 product version of uipa studio and it is applicable to newer version as well so this is the course which I feel the ideal one to pick for now in this course you enroll for this course and then get into the course now this course is of around 1 hour you know one know 1 hour plus 1 hour2 minutes I think now in this one which are the important topics or which are the important statements or the state you know the sentences which are important for the exam I am going to cover so let's get started first of all I'll give a demo and once we complete the demo then we will go through the academy and I'm going to highlight the important points for you which will help you for your exam so I hope you are ready so do not skip the topic do not skip this video please listen to me until the end that is where you will gain complete knowledge on state machine so let's get started now State machine if you open your UA studio and type State machine in state machine there are only three activities how many activities so all these important points I'm going to type it on the notepad you can make a note so how many activities there are three activities only three activities in total now what are those activities in state machine the very first activity is State machine the second activity is State and the third activity is final state so that means all you have to learn around these three activities State machine State and final State here you can see them now what is the state machine Let's see first first thing in your designer panel the very first activity if you have to start your state machine project the very first activity that you have to drag is your state machine activity which will act like a scope this is more like a scope you might have worked on Excel scope you might have worked on uh UI you know UI browser open application activities right so all those activities are your scope activities similar way for the state machine this is the scope activity that means all other activities will come inside this particular scope scope all right now remember the state machine scope activity contains a very important thing this is called the start node what is this called a start node simple now once you have the start node the next thing that you have to drag and drop is your state activity now the state activity you can drag and drop multiple State activities inside inside this okay like that you can continue depending on different requirements so let's say if you're dragging and dropping couple of State activities the activity which is connected to the start node is known as initial State very important key terms I'm giving you this is known as initial State okay remember the activity which is connected to the start node is known as initial state so now we are learning the state okay so what we are learning in the state the first State activity connected to start node known as initial state is it clear this is known as initial State because this is where your project would start and remember there is a concept I'm going to talk about that later if I say it now it might confuse you so for the moment just remember this is called initial State okay now let me delete all of this another activity that is called final State there's another activity called final state so what is the difference between initial State and final State this is very important question okay difference between initial State and final State initial uh I mean difference between the state activity and final State activity so what is the difference between the state activity and final State activity let me open the state activity so I've given a name as initial State because it is connected to start node remember that otherwise it is a state activity now State activity contains three important important components what is that entry exit and transitions so State activity a state activity contains three important things one is entry second exit and the third transition right now if you look at the final State the final state only contains entry remember that final state only contains entry getting it very important this is also important from the exam point of view the state activities contain three different components or sections entry exit section and transition section and the final State activity only contains what entry section now why entry because here it is going to end it is not going to get into some of the state This is the End state right now let's take some example to understand this okay now how to utilize this initial State how to utilize the final state so these are the three activities State machine State activity and final State now how to utilize let's understand in detail now for this so you have made this note right important notes I'm going to erase this now here we will take some example first thing we will we will take a example of a customer care okay there's a customer care where the customer will approach and he wanted to take ticket for bus or a ticket for train or you want a ticket for uh flight so these are the three options so this customer care generally provides him the information for bus ticket you go to right the customer care generally provides him some information what you go to uh gate number uh one let's say train you go to counter number so based on the availability who is sitting in the counter let's say 1 2 3 now for the flight you should go to the counter number let's say 160 so something like that you know this is this is just I'm creating a simple example so that you understand how to utilize State machine okay pretty simple example to start with now what we will do the moment you start your project the project would enter to the initial State the very first state activity is known as initial state if I open this there's an entry now in the entry what I will do I'll put a message box pretty simple example you will first why a simple example is required once you understand how it works then you can go for complex to complex scenarios but you should know how the flow works when from entry it goes to exit right when from exit it goes to transition can I if I leave it blank what would happen so all of these things are important to Le message box inside this I'm saying welcome to customer know travel agency customer care let's say travel agency customer C and I'm saying to continue to to continue click okay and when you are writing bigger sentences it's better to open in a bigger window and I'm saying to continue click on okay or okay to exit click on cancel so I'm giving two different option sometimes a customer might be by mistake he had come and he would like to come out of it so you can click on cancel to exit now for that so this is the message we have provided for this message box I'm going to create some two buttons okay and cancel okay now what would happen the moment customer clicks on okay then it should go to the next step if it cancels then it should go to the final State now for that what I'm going to do I'm going to create a but variable here and say Choice what is customer's choice so here I created a variable called Choice done now I have kept a final State let's say the user is hitting on cancel it should come to the final State now for that the moment you connect a f final state so for example this transition is not there the moment you are connecting a state machine activity a transition get automatically created remember this point for example the moment I'm connecting a final or whichever State activity you know the moment you connect a transition automatically gets created and you can rename this transitions now if you open this initial State you can see from this state you have given a transition to move to final State now very important part you have to a condition when it should go only when the customer clicks on cancel and whatever the customer is clicking that is getting stored in a variable called Choice with that information let's go to this transition click on that and here there's a area called condition in this area I'm going to Simply say choice is equals to I'm going to say cancel if the choice is equal to cancel then it should move to final state so when it comes to final state I'm showing another message here in this message box let me type thanks visit again okay some message I'm putting when they are exiting now let's first understand this how it is working okay I'm going to run this and what happened as per design this is the message box which is appearing welcome to travel agency customer care to continue continue click on okay to exit click on cancel so we have designed for cancel if I click on cancel now the choice variable will get that cancel value and as for the condition it is coming to the final State clear so how it is coming to the final State we have understood so this condition this transition is very important the kind of condition you put here if the condition meets then only it will come here now if the condition is okay if the customer is clicking on okay let's say the customer has clicked on okay then I want him to go to a state where I'll ask few more question to him so what I will do I will use another state activity okay so I want let me keep the final State somewhere here okay so if C say cancel then it goes to final state but below here I'm going to connect one dot so this is a State now here I'm going to ask few questions what are the question I'll ask click on it and use a message box I'll use a message box and here I will ask him okay select what kind of travel you need bus travel or train you would like to travel through train or you would like to travel through flight so I think instead of a message box a input dialog box would do good input dialog box okay now if he has clicked on okay then only it should come to the state now for it to come to the state or let me keep the final State this side so that doesn't confuse people I'll connect this transition to I'll connect it from here so that I understand okay so it is it will come to this state transition two now here we will create some condition so click on this transition two and the condition that we will keep the choice right he made a choice which is not equals to okay uh not equals to cancel right so choice is equals to or you can say choice is equals to okay if choice is equals to okay then it should come to this state the choice is okay it should come to this state now in this particular state I would like to show him some input dialog box where I'm saying how you would like to travel select how you would like to travel this is the question I'm asking and I'm going to show him some multiple choice and here let me give some options so how do you write options here in this new input dialog box I'm going to show you so how do you write you first use a because this is a string okay so you'll simply use a double code and inside the double quat you will say let's say bus is my first option separated by semicolon and then train separated by semicolon and then flight okay without any space I'm simply writing more like one string but separated by semicolons done now here I'm going to hit on Save now what happened whatever the value he's going to select it should get selected in a variable called I'll create a travel Choice the variable name is travel Choice done pretty simple now let's see if the if this is working or not first of all let's see if it is working or not and then if he has made some selection let's say he has made a selection okay I want to go through bus then if he has he if he wants to go through bus I'll give him a I'll connect a state activity here let's say he selects I want to go through train I'll give him a action State activity here if he wants to go through this one I'll give him like this so now what happened these are the three different state now the first state is around bus the second state is for train and the third state is for flight done now as we have all this bus and all that we have to start designing it let's say the customer has selected bus now in the transaction three if you click I will say travel Choice e is equals to and you have to write bus okay now let's see if this is first of all walking or not okay bus and I will go here and I'll pass some message to him and say go to uh counter number one 121 some some number I'm giving for for bus tickets I'm providing which counter to go this the simple information I'm providing now let's say he got that information at the end I would give him a I'll use another final State we put another fin this can be organized in much better way but as we I'm just doing it live so I'm just trying to organize as best as possible while I'm recording this okay now here what would happen if he has clicked on okay then it should come to the final state in the final State I want to put him a message wishing you save Journey you save Journey clear now the same thing for train also we will do okay what we will do we simply try to copy this activity go here and the train I will say go to counter number let's say 131 for train tickets done the same thing we will do for the flight I'll go here copy paste I'll say go to 161 for flight tickets done go back now all of this state look at this all of these are having error okay reason being this should be connected this should be connected okay now for example here I will connect to this one it should connect to final State and after having the flight then I would say save Journey wishing you save Journey so I'll connect all of this to the final State drag and simply connect so all are connected to the final state so this is like wishing you save Journey now what happened here still I see an error because for train you have not select provided a condition so what is the condition for train travel choice is equals to you have to say train okay and then here I would say for this transition I say travel choice for this one is equals to flight done pretty simple one now let's understand so how it will work it'll come here and in this it'll say welcome to travel customer care now he has got two options okay and cancel if he cancels then this button get transition get activated it will go to final State now in the final State we have only in one entry box we have kept a message box which is going to say thanks visit again let's say he has clicked on okay if he has clicked on okay then it'll come here what is the condition we have provided here choice is okay then it'll come to this box now in this box we are providing some options to him bus train flight and all that so we giving some travel choices now all of these boxes you can name it as per your choice okay now for the demo purpose I'm just leaving it as it is but the best practice is to name them based on the activity that you're doing inside now let's say customer selected bus so here there's a transition where I'm saying travel choice is equal to bus then it'll come to this area now in this one in the T6 I have not put any condition so you can also have at least one you know one transition without a condition it is allowed okay one one without any condition it is allowed you cannot have multiple transitions without conditions at least you know one is allowed for example let's say just for demo I'm showing for example if I going to connect this to this now here this's error if you read this triggerless transition T6 of State bus must contain a condition a state can only have one un unconditional transition so you can have one remember it is a very important Point how many unconditional transition can you have in a state that is one only one okay remember this important point so here you can see in the message so let me delete this because this was unconditional this is also unconditional so it is saying you can only have either one you can't have two two unconditional ones so here in the T6 I didn't put any condition so it's a unconditional transition it simply go if it comes here it'll go here right so this is done now let me run this and see whether it is working or not okay so the what is the very first thing is going to happen it has come to the initial State and welcome to travel agency customer care to continue click on okay so if you cancel it go to final State we saw that now I'm going to click on okay now if I'm going to click on okay I came to this box do you see this got highlighted and in this box we have kept our input dialog box saying bus train and flight let's say I'm going to select bus and click on okay so what would happen after that it has come it will come to this one go to counter number one 121 for bus ticket click on okay and after that it should come to this one wishing you safe journey it is coming to the final State wishing you save J done now let me run it again run it again so here the first initial state is working then let's say I'm going to select flight flight means here in the second box it select 5 T5 is equal to flight then it will come to this box flight and here go to counter number one 161 for flight tickets okay and then it is coming to wishing you save Journey so now you got a practical demo of it now let us also understand few more things inside a state activity okay there is something called exit now how when this exit will work I'm going to show you okay now here look at it this is the state right input dialog box now this exit will only when it will come when you are exiting let's say you are made a choice bus train or flight so whatever choice you have made you are going to exit out of the state you will go and enter a different state so while you are entering a different state it will work if it doesn't enter any state the activity that you keeping here is not going to work for example very important point so don't think don't think the activities let's say you have kept some activity here message box or something don't think after this activity it is going to work no it doesn't work like that it is not a sequence this is going to work when it enters the state this is going to work when it exit the state I mean when it is going to either bus State train State or the flight state that is where the moment while it is going before it reaches there it is going to appear now for example let me show you I'll have a log message okay this generally you can utilize for log messages so here I'm saying um exiting the uh exiting the what is the state this one uh State exing the uh what state input dialog state right input dialogue state so here I'm just asking a input travel input dialog right so travel input dialog State log level info okay now let's look at how this is going to work save let me run it welcome to travel agency customer care to continue click on okay done now here look at it look at look at this area because I've created a log message if I'm selecting train let's say so what would happen this state will get exit because the train is there the condition is train the travel choice is train then it'll come to this particular state so why before it reaches the state it will write the log message so for example if I click on okay see it has written exiting the travel input dialog state so it has WR a log message so while exiting whatever activity that you have kept it is going to work during the execution it doesn't work while exit we have made a choice and it's going to a different state and that time it'll check in the exit box if there is something so you can see there are two circles that means I'm using a entry box here here I'm using entry and the exit box you can see there are two symbols so what before you enter here it is showing the message otherwise that exit box won't work while exiting only it will work remember this important point now go to counter number 131 I got it and after that it'll come to final State wishing you save Journey getting it so now you have got a demo of it now what are the key points see at the end after you have learned all of this thing what is important is getting the key points what are the key points this is very important now I will go to uabat academy and show you what are the key points okay the important key points now you have seen I'll read through because it is linked to okay leave that um leave that so there are two different three different sections you have learned entry exit transition entry section contains the activity that are to be performed when the state is entered when you enter into the state okay exit section contains the activity that are to be performed upon exiting the state that this demonstration I've given you while exiting only it was writing the log right while it was in that state it doesn't write it doesn't work only when it exist out of the state it was writing then transition where you provide the condition section lets you add activities that will be performed before switching from the current state to the desired state so some condition that you have provide here add AC that will be performed before switching from the current state and in this transition there are also couple of other things trigger and other options are there we will discuss that but again you understood there's a box in the transition called condition box a transition are created when you link a state to another state when they are created when you're linking it or to a final state within a state machine container as observed the condition to transition to destination State the heat state for example when you are when you're writing a condition that means you're putting a condition when I should go to the next state like Bus and Train and all those States we have created so you had put a condition travel Choice was bus so you go to bus travel Choice was train so you go to train right so this is the condition very important property now look at the note this is important while on the air conditioner is the either in the transition state as the air conditioner processes continues not this one uh I think this is the note this is the note look at it I'm going to read it when any non numerical input uh this is about the example given in uip paath academy uh final State workflow for okay leave that leave that leave that this is important yeah you can only create One initial State very important Point make a note what is that the very first important point is you can only create One initial state that means because there is one start node in the state machine scope the first state machine uh the state activity that you have connected to the node so this becomes your initial node so you can only have one initial State this you might might have seen a question in the practice test okay very important one you can only create One initial State okay important point to note next yet it is possible to have possible to have more than one final State another important Point possible to have more than one final state next All State machines must contain an initial State at least one initial State you should have right it has clearly mentioned you can only create One initial State All State machine must contain must contain an initial state so how many initial State you can have only one and at least one final State final State remember the final State you can have multiple you can have more than one remember you can have more than one final state but you can only create One initial state so at the end what they are saying One initial State you should have you know state project and one or more final State you can have this is a very important point in the practice in a couple of other areas you will see this question okay very important statement very very important statement okay so this you have learned right these are the important point that you have learned now I'll you know I'll stop it here and I'm going to create some questions for you I'm going to show you the questions in the practice test on the state machine with this learning most of the questions I think you will be able to answer it so let's see how you are performing in those question section so let's move on to our next topic guys we are going to learn some of the questions and what should be the right answer and why the other options are wrong around the state machine so let's get started the very first question which of the following is a characteristic of the final state in a state machine options are must have at least one transition configured from the final State now for this to understand this what you do simply drag and drop a state machine scope and a state activity and a final State just connect to it okay so what are the question we'll understand the very first point it says must have at least one transition configured from the final State no see if you open Final State you don't have transition so from the final State you can't have a transition that is the end that is the end but from a state activity you can always have a transition right you can't have a transition inside a final State you can only have entry so that means this statement is wrong option number two a state must be connected to a final State now what is the understanding on this question is for example a state is connected to final State now you might be having a question what if I am having another state in between that is also possible Right a state is connected to this state and instead of this transition let's say it is connected like this from this one to this one so it is talking about the overall project a state must be a state at least a state single state should be connected to final State you might be having multiple State activities but a single state activity should be connected to fin ST which is right at least right a state must be connected to final state so this statement is correct now let's look at why these two options are wrong that is very important during the exam to understand what is correct and also to understand which options are incorrect so this is incorrect now let's look at the third one a final State can only transition to another final State activity no final state is end it doesn't transition so this is also Al wrong now a final state contains the transition and the exit section this statement is also wrong because in the final State we only have what entry so what is the right answer this is the right answer let's see the next question a process required by the finance team was developed using the state machine architecture one of those States needs to be able to transition to four other different states so it is saying let's say there is a state activity from one state activity it has to go to four other states okay it should move on to another four different states okay and all are connected to the initial State something like that okay so it is going to four different states based on the business condition based on the condition in which of the following should the transition logic be introduced where before it moves from one transition to the other transition right where would you put that logic okay let me clear it it is too much okay for example this one okay just take this example from one state it has to move to another state so where would you put that business condition okay in which of the following should the transition logic be introduced so when it transition you click on this transition activity and inside this transition activity you put in the condition right this is is where you put the logic based on the condition it will move so the condition is the answer so here if you see option number one in the entry action of the target state where it has to go no this is wrong right in the exit action of the source State no you don't put a condition there so it will only transition remember in state machine from this state it comes to this state based on this condition so the answer is always condition so this is wrong this is wrong in the trigger section of the transition this is also wrong not in the trigger section I'll show you how to use the trigger section but the answer here is in the condition section of the transition okay you always put it in the condition section based on which it will move now let's see one more question in uipath state machine project which activity is mandatory as top level container for defining the overall structure and organization of the automation process so it is talking about you have a state machine the top level container what is the top level container sequence State machine flowchart wide Loop of course the answer is State machine State machine itself is also an activity which works like a container right State machine itself is an activity which works like a container so here your answer is State machine all right guys so most of the relevant questions on the state missiones we have covered let's move on to our next topic we are going to learn a very specific technique around the state machine here you see a transition activity that is connected from the state machine to the final state if you click on this transition there is a section called trigger section so how to utilize the trigger section I'm going to show you in this video so here our topic is around the trigger section of State machine now there could also be a question in the transition how many different sections are there what is your answer so here we have a trigger section condition section and acction section remember that in a trigger activity there are three sections one is known as trigger section second one is condition and the third one is action okay trigger condition and action now let us go through a demo which is going to explain how this trigger condition and action can be utilized now for this we have to take some demo what is the demo here is my application in this application if any one clicks on the submit button what is it because I'm using trigger right so if anybody clicks on the submit button The Click trigger should get activated and once the click trigger get activated it should move to the final State getting it anybody clicking on the submit button will activate the transition so from here it will flow to final State okay now for that the very first thing we will do in the entry section I'm going to add the the activity use application browser activity let me drag and drop this here I'm going to click on indicate and I'm going to indicate this application done now once I have indicated the application I'll go to the next here there's a transition inside this transition the very first activity I'm going to drag and drop is the trigger scope activity because you know all the trigger activity needs to be kept inside the trigger scope okay okay so I'm saying trigger scope and here is the trigger scope activity this trigger section I'm going to drag and drop a trigger scope activity after that here I have to drag a trigger activity for example click trigger here are demo is around click trigger so I'll drag and drop the click trigger activity here let's indicate element on screen and indicate the submit button done so it has indicated the submit button after that after that in the trigger scope activity there is also section called asks and action section okay here there's a sequence there's a blank sequence by default in this one let me drag and drop an assign activity and here let me create a Boolean variable called click which is going to store if somebody clicking on the submit button the value will become true it will come to the action section so when this click trigger get activated it always comes to the acction section and here whatever you have defined it is going to work so here I have used a bullan variable called clicked so let's change the variable type to Boolean and let's set the this one to State machine the scope all right here let me put a value called true the buan value True by default I will keep the clicked value as false the default value all done now the moment anybody clicks what happens the clicked variable is going to get the value called true because once it is clicked it will move to the action section and here it'll get gain the value after that in the transition activity there is the next section called condition in the condition section I'm going to say click is equals to you can simply write the variable or else you can simply also say true if the clicked value becomes true then I want to log a message and I'm going to say user clicked on submit button so it is going to log it and I'm going to keep it as information simple now you have learned how to use the trigger section and you have also learned how to use the condition section and action section okay now if the condition meets then you should enter the final state in the final State let's add one more log message activity and here I will say enter the final State this experiments are very important so that you understand how the workflow logically flows from one section to the other section in the state machine so now we have understood here I have kept only very simple activity called use open it'll just open that application and once it has opened the application if it is already open it'll leave it as it is you know right there are couple of properties that you can also utilize for example this one I will say open if not open we can set all this done and next it'll come to the transition where it will continuously monitor the submit button anybody clicking on the submit button then it'll come to the action section and here the value is getting true and here I put a condition click is equal to true then it will come to the log message saying user clicked on the submit button pretty simple workflow now after this let me quickly debug this so that we understand how the workflow is working all right all right so the automation started running now let's see the status so here this is the application you can see it has started running so I'll go here and it has been activated right you can see it is executed that means the application is currently open now it is continuously going to monitor if somebody is going to click on submit button let me go here and open the transition now the transition you can see it is continuously monitoring now there's one important thing that I forgot that is when you use a click trigger it continuously monitor now to break that sequence of monitoring you must use a breake activity very important point to break the sequence of your trigger scope activity you have to use a break activity so it breaks so it breaks the loop and goes to move on to the next section other it will be always be inside that section so let me debug it once again okay all right so the automation has started you can see the browser is already open so it got executed and then if I go to the transition section here it is just waiting if somebody is going to click on the submit button or not now let's say I'm going to click here see nothing is going nothing is working right you can see this activity did not run yet now the moment I'm going to hit on submit look at it if I'm going to hit on submit look at it I'll keep it this side I'm going to click on submit and what would happen this click is this click trigger activity is waiting the moment I hit on submit look at it what's going to happen submit you can see it has immediately came to this particular section and now if you look at your output it said user clicked on the submit button entered the final step state so it has entered the final state where we have kept that activity log message activity so if you look at the output all these things has happened so now what happened your workflow has moved from this state to the final State as per the transition that you have kept so in the transition the condition was simple we have used a trigger scope and it has monitored whether somebody's clicking on the click button or not based on that the value has been transferred to the C variable and then based on the condition it logged it and it went to it went to final State pretty simple please do try this out I'm going to show you one of the question that is there in the uath academy practice test let's answer that we are going to answer a question on the transition activity now when you hear this transition activity it is part of your state machine let's read the question in a UI Path State machine what are the three sections found within a transition activity when it's expanded okay the questions are the options are entry condition and action entry exit and transitions trigger condition and exit trigger condition and action now which one of these are right now this might confuse you transition activity what is a transition activity in the in my previous demo you might have already seen it but let me show you the moment you have a state activity and you are connecting it to let's say another state another activity of State machine let's say n state or any other state the moment you keep it what happened a transition get created for example if I'm going to drag and drop let's say another state activity the moment I drag and drop and so what happened another activity that get added this is known as transition if you click on it you can see that activity so this is what it is talking about this transition activity contains three different sections what are the trigger condition and action trigger condition action okay so here your option is trigger condition and action where do you find this documentation this is the documentation I'll pass this link in the description of the video you can have a check here if you see the transition activity cannot be dragged from the activities panel like a conventional activity it is generated when you link a state to another state or to a final State just now we saw it so very important point you cannot drag this activity from the activity panel it get automatically created when you link it when you link a state to another state or final state within a state machine container this activity helps you input conditions under which the automation project can pass from one state to another so what is the purpose to pass from one state to another state pretty simple okay you can find out more okay leave that now look at this option States can be linked to multiple transitions so you can link one state to multiple transitions right for example if I drag and drop another state here now can I link it yes so you can you can have multiple different states States can be linked to multiple transitions so you can see one state has got now two transitions like that you can have more than one each describing a possible way to pass from a state to another clear very important and we saw this condition the condition under which the state can be transcended that means it can move from one state to another state and in the previous video I have given complete demo that demo is very important please do have a check okay so I hope you'll be able to you know why this answer is correct trigger condition action so thank you now I have another slide prepared and have created few questions and these questions are framed based on this particular documentation now let's see if you can answer those questions as well so here it is now let's go through these questions and see if you can answer them let's get started the very first question which of the following statement is about out the transition activity in uath state machine is correct options are a the transition activity can be dragged from the activities panel directly so just now you cannot do it right so this is a wrong answer B it helps input conditions for passing from one state so there is a condition in the transition this one for passing from one state to another within a state machine container is this right C line breaks are supported in the condition expression field is this one correct d it only accepts string variable so what is the right option please do comment okay you commenting on my videos are very important so please do comment it is nice to always see people are participating for the effort that I have put to create and help you guys in different ways now here the answer let me reveal it is B it helps input conditions for passing from one state to another hope you had the you have commented the same option question number two what does the transition activity allow you to Define within a state machine in uipath options are now always read these options carefully this might confuse you and you might go and select a wrong wrong answer so be very careful State execution order the conditions for moving from one state to another what do you use this transition activity for see activities to be performed within each state do you define the activities to be performed in within each state or state machine display names what is what do you really use it for now please do comment your answer am sure most of you will go right on this question because this is pretty simple you use the transition for writing conditions right the conditions for moving from one state to another let's see the question number three what is notable about the relationship between states and transitions in a state machine options are each transition can move between multiple States so each transition can the transition move or from one state to another state you move through the transition okay B states can have only one transition a state can only have one transition is that true C States can be linked to multiple transitions from a single state you can link it to multiple transitions D transitions are limited to linking to two states only you can only link it to two different states now out of this what is the right one please do comment your answer okay okay I hope you have already commented now let me reveal the answer the answer is States can be linked to multiple transitions from one state you can link to multiple different you know you can have multiple transitions from one state and connect to other different states all right guys I hope you have given all the answers correctly now let's move on to our next topic we are going to learn a new technique if you see in the transition there are two conditions do you see the condition here and there's a condition here the first one goes to get transaction data and the second condition goes to end process State now here the question is if if you look at both the conditions are same system exception is not nothing system exception is not nothing so the question is it is asking what would happen if the system exception is not nothing both the condition are same is the successful is going to run or the system exception this block is going to run now have you seen any kind of a transition like that where you have two two conditions how to do that everything before we completely go through this question we will first go through a demo so let's get started first thing let me drag and drop a state machine activity let me expand this drag and drop a state activity here and in this state act below this I'm going to add one state activity and one final State activity okay so here I will name it as let's say end State just to correlate with the question I'm going to say end State and this one let's say I'm going to say it as get transaction data okay now here in this state from this state let's say I'm going to connect it to this state get transaction data and the get transaction data n after it finishes it will come to come to the end state if you click on this transition which comes from the initial state to get transaction state so let me name it as initial State here in between there's a transition so if you double click on this here you see only one condition okay so let me create a condition for that in the initial State activity let me create a input dialogue box okay and here I'm going to say enter number and the number let me create a variable and I will say choice and this variable let's make it as a integer type okay now the condition that I'm going to make in this one if the customer is entering one then it should come here if the customer entering two it should go to different state let me click on this transition so the variable that we know is Choice okay so here I'm saying choice is equals to 1 if the customer is selecting choice is equals to 1 then it should go to get transaction data in this below here you find something called add shap trigger transition so let me click here and here I can select the another state so let me select the end State the moment you select what would happen if you see the question that you saw where you had a trigger and there are two conditions if you compare this with this picture you can see there's a condition here the first one T1 and a T3 got created and there's a condition here okay now what is this T3 it is connecting to end state if you go back to the main you can see when you have created a shade transition what happened it is actually another transition called T3 which got connected to end State okay but again if you click on it you see two conditions are return so the question also has a similar kind of a picture where you have a condition and below that you have another condition so looking at it you should not get confused now this would have given you clear picture you know the moment you click on art share trigger this is how it get created now let's say here I'm going to say choice is equals to two if custom is entering two then what happened it should actually go to end state it should actually enter to end State now in this acction section let me add a simple uh message box message box and I will say just to understand how it flows okay here I'm say ENT third T1 transaction one okay or uh just to uh you know make it more like the question you can name it like successful right how it is defined in this question successful so I'm naming it as successful and uh here I let me name it as system exception okay so here I'm saying entered successful entered system exception ENT system exception okay so this is the message box will appear if it at all comes here now look at it let's understand how it flows first of all if I'm going to debug this in the initial State we have kept the input dialog box right so it is asking enter a number if I enter one what happens then because one then it should get into get transaction data right so if I click on okay so what happened it says entered successful so it is taking this route okay and then it it goes now here just to understand whether it is coming to this state or not I'm also going to add a message box and say uh entered get transaction data State okay just to ensure to understand the flow then if it comes to end State then it should say entered and state done now let's go and run it once again so here once again let's if I say one what would happen click okay so it entered successful transition and then if you click okay then it says entered get transaction data State now from here it will go to end State and here we have not defined any condition so condition less transac know transition can also be created so it entered the end State understood now if I run it again if I enter two and click on okay it will take this route see it took this the system exception route okay this route system exception route entered system exception and then it will enter the end State getting it now the question actually is if both your values are same let me come here and click on the successful if I make choice is equal to 1 and let's say choice is equal to 1 so here both the conditions are same now the question is whether it will go to the successful or it will follow the system exception path when the values are one let's say you entering the value one will it go this way or will it go this way that is the question slightly tricky right or is it going to give an error now let me tell you what what is going to happen if I'm going to run this okay and uh now it is asking enter a number do you think it will give an error because here also you have put a condition called one so will it come this way here also you have put a condition called one will it come this way way now let me answer you for example if I'm going to enter one here and click on okay now which path it took it actually took the successful path you know why it is taking it is not taking the system exent path because if you look at the sequence in the transition the very first thing you have written is successful so whatever is there on the top it will just take that route when both the conditions do match click okay and entered get it entered here get transition data and then it goes to instant so you understood the flow so remember anytime you see this kind of a question where the conditions are both same whatever you have mentioned here because it will run in a sequential order right so here it'll see Choice equal it met so it'll go to get transaction data so it will not at all work on this one so you can see this got checked but it did not come here because it already met the condition the first one so whatever is there on the top that will take precedence now let's read this question let's read this question now here the question is a developer found a bug in one of transitions shown below both conditions are same so if you see system exception is nothing is not nothing that means there is a system exception system exception is not nothing so that means there is a system exception so if a system exception has occurred as per the bug I know as per the design the developer has done what would happen it will take the successful route so if you see here it is mentioned successful so you will take this successful transition and here if you look at the condition is same and the transition path is known as system exception it won't take the system exception it won't go to end process it first it will go to get transaction data getting it so here the uh question is what transition or transitions will be executed do you think both of them will get executed or one transition will get executed here are your options will it go to system exception successful right these are all transition names no condition the state will remain in a hanging state will it go in a Hanging State successful and system exception so we already saw that it was going to successful in this particular demo so the answer is successful and we pretty clearly saw that in this demo when the values are same it always take the first one which is mentioned which is successful
Info
Channel: Automate with Rakesh
Views: 1,805
Rating: undefined out of 5
Keywords:
Id: Z5eOndJqf_4
Channel Id: undefined
Length: 78min 26sec (4706 seconds)
Published: Thu Mar 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.