How to use a Flowchart

Previously, we have seen how to use a Sequence and activities. We shall now learn how to use a Flowchart. A Flowchart is a container. It can contain activities inside it.

I order to use email activities in example please install UiPath.Mail.Activities. You can find it by clicking on Manage package icon or pressing Ctrl + P and search for mail in all package.  You will learn more on packages in Chapter 6, Taking Control of the Controls

 Let us drag and drop a Message box activity inside the Flowchart. Double click on the Message box and type "Hello World!" in the area where the text is to be quoted. Press F5 to see the result):

So, when the program has only a few steps, we can use activities directly inside the Flowchart. However, it becomes more complex when we have a large number of steps. That is why it is necessary to arrange the related activities into Sequences and then group the Sequences into a Flowchart.

Let us take an example to see how to use Sequences in the Flowchart.

We are not going to implement the actual code for sending the email. It will be covered later in detail. The aim of this session is to clearly understand where and how we use workflows and Sequences.

Perform the following steps:

  1. Drag and drop two Flowchart activities on the main Flowchart. Rename them as Send Mail and Message.

We have two different workflows. The Send Mail workflow will send the mail to an email address. The Message workflow has the message body of that email and will ask the user for a name, message, sender, and receiver.

  1. We have to implement the desired steps in both workflows.

For that, we are using a Sequence inside the Flowchart. Double click on the Flowchart. Drag and drop a Sequence activity inside both Flowcharts. Connect the Sequence to the Start node by right-clicking on the Sequence and selecting the Set as Start node option.

  1. Double click on the Sequence in the Message Flowchart. Drag and drop four Input dialog activities for the name, message, sender, and receiver (in this Sequence, we are not going to set any property of the Message box since the purpose of this lesson is to clearly understand where and how we use workflows and Sequences):

  1. Double click on the Send Mail Flowchart. Double click on the Sequence. You can drag and drop the email activities here. (We are not going to drag any mail activity although you are free to do so. There is another chapter for that). 
  2. That's it. Now, go to the main Flowchart. Connect the Message Flowchart to the Start node. Also, connect the Send Mail activity to the Message Flowchart:
  1. Run the program and visualize it.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.174.168