Вы находитесь на странице: 1из 26


How to Build Bots with SAP Intelligent Robotic

Process Automation
Week 02 Unit 01

00:00:05 Hello, everyone. Welcome to the openSAP course of SAP Intelligent RPA,
00:00:11 week two, unit one. I am Moumita, I am part of the SAP Intelligent RPA team.
00:00:17 In this unit, I am going to give you a brief overview of how to declare applications that need
00:00:24 to automate in Studio Explorer. It's all about how to make the automated process
00:00:31 understand in which element to click, read value, or perform some other actions.
00:00:40 First, we will see the different components available in SAP Intelligent RPA Desktop Studio
00:00:47 to create our automated process. First, we have Studio, where we create the project.
00:00:57 It has five subcomponents. They are Studio Explorer, Workflow Designer, Editor,
00:01:03 Debugger, UI Designer. Then we have SDK.
00:01:08 We can say this is the heart of the development. It contains project templates,
00:01:14 SAP Intelligent RPA Framework and extensions, all the prebuilt libraries to automate processes,

00:01:21 and other resources like entities. Next we have the Framework, which contains
00:01:28 the JavaScript ctx core language, language extensions for specific functionalities,
00:01:34 like single sign-on, and so on, language extensions, and collaborative approach.
00:01:41 Last but not the least is the Project. It has Studio content, declaration files,
00:01:48 workflow files, UI resources, and JavaScript files. Next, this is a high-level design of the Studio
00:02:01 and Projects. So, here we will go for the first application declaration.
00:02:11 We have first the Development phase... In the Development phase, we have two parts.
00:02:19 One is the Declaration phase, another is the Workflow Design.
00:02:24 Let's dig into the details. First is Declaration phase,
00:02:28 where we define all the applications that Desktop Agent has to monitor,
00:02:33 or interact with during automation. Then we have Workflow Design, where we can define
00:02:40 the business logic, such as steps, action, condition, and so on.
00:02:47 The main purpose of SAP Intelligent RPA is to automate human tasks
00:02:52 that are executed on applications running on some machine, and this is the high-level
00:03:00 of how the application interacts with the Desktop Studio, Desktop Agent, and underlying OS in
different phases
00:03:07 of the automation cycle. We have Desktop Studio,
00:03:10 where we capture the applications. Desktop Studio provides the underlying structure
00:03:16 of the application and recognizes the UI elements. In runtime, Desktop Agent interacts with
00:03:24 which has been defined previously during the development cycle in Desktop Studio.
00:03:29 There are a set of connectors for different types of application
00:03:34 which make the communication between the operating system and Desktop Studio for design
00:03:41 and Desktop Agent for runtime. These connectors provide the underlying structure
00:03:46 of the application during development time, and identify the application and its respective UI
00:03:52 during runtime... To automate the business process,
00:04:00 we need to declare different types of entities to make the RPA process understand
00:04:06 with which application to interact, what to read, what to write,
00:04:11 some values, or some other actions, such as click, browse, and so on.
00:04:16 First, we need to declare applications that we need to control through our RPA process,
00:04:22 such as Notepad or the SAP Logon application,. The application entity is responsible
00:04:29 for communicating or interacting with a running, real-world application.
00:04:34 Applications are defined in Studio as a hierarchical structure of pages and items,
00:04:40 and optionally sub-pages. An application entity can contain multiple page entities
00:04:48 that can communicate with part of the application's user interface.
00:04:53 Each window, such as login window, or each webpage of a website, such as login page or
00:05:01 can be defined as a page entity. A page entity again can contain one or multiple entities
00:05:09 – those are called item entities – that will communicate with elements of the page entity.
00:05:15 For each component which we want to interact through our automated process, we need to
00:05:22 as an item in Desktop Studio, such as all the input fields where we have to perform
00:05:29 read or write operations, buttons where we have to click,
00:05:33 or any combo box where we have to select values must be defined as an item in Studio
00:05:41 Finally, we have process entities, which execute internal tasks that are not directly related
00:05:50 to a running, real-world application. One such example is manage applications via API,
00:05:57 like Microsoft Excel, Microsoft Word, Microsoft Outlook, and so on. Desktop Agent monitors the
00:06:06 such as click on a button, select an item in a list, and so on.
00:06:11 Similarly, technical events such as application load, page load, and the like are sent among the
00:06:22 In high level, there are two types of technology available for application.
00:06:27 One is desktop technology, and another is the web technology.
00:06:32 In desktop technology, we have three entities which we need to define.
00:06:38 First is the desktop application, which is any EXE application running on a machine
00:06:44 with user interface. These include applications developed
00:06:48 using technologies including Windows, Java, Silverlight, and so on.
00:06:53 Each of the screens of a desktop application is considered as a page.
00:06:59 When we capture a screen of an application, then the responsible connector returns
00:07:05 the underlying DOM structure. The root element of that DOM is the page,
00:07:10 and any element of the returned DOM can be defined as an item.
00:07:15 Optionally, we can capture a certain section of the screen instead of capturing the complete
00:07:23 and that needs to define as a subpage. Another major tech application used
00:07:31 is based on WEB technology. Any application which is running in a web browser
00:07:36 can be considered as a web-based technology except Java applet, Flex, due to different plugins.

00:07:43 Here also we can define three different entities. First is an application entity,
00:07:49 which is a set of web pages with the same set of criteria displayed
00:07:53 in an instance of a web browser. Supported web browsers are Internet Explorer,

00:07:59 Chrome, and Firefox. Second we have web pages belonging
00:08:04 to the same web application, but displayed in two different tabs of the browser
00:08:11 are considered as two different application instances. Once we capture any web application,
00:08:20 the respective connector returns the complete DOM of the current web page.
00:08:25 This complete DOM is defined as the page entity. Any element of the DOM can be defined
00:08:32 as an item of the page. Different technologies are available to capture
00:08:39 different applications in Desktop Studio, WEB technology to capture web applications in a web
00:08:45 Supported web browsers are Internet Explorer, Chrome, Firefox. WIN for Windows Desktop
00:08:55 which is Win32 or Windows Forms. UIAutomation for other desktop applications,
00:09:01 such as WPF, Silverlight, QT, and so on. It can also be used for Windows applications.
00:09:09 UI automation is a standard protocol developed by Microsoft.
00:09:14 Then we have HLLAPI for HLLAPI emulated mainframe applications.
00:09:18 SWG for Java applications like Swing, AWT, and so on. Next I will guide you through how to
declare applications
00:09:27 in SAP Intelligent RPA Desktop Studio. I will declare two applications.
00:09:32 One is a Window applications, another is a web application... This is SAP Intelligent RPA
Desktop Studio.
00:09:45 First, I will tell you the different panels present in the SAP Intelligent RPA Desktop Studio.
00:09:51 Next, we will see how to declare the application. In the top horizontal panel is the main bar.
00:10:00 Next to that we have the toolbar. On the left-hand side, the vertical one is the different
00:10:08 which is present in the SAP Intelligent RPA Desktop Studio. Currently, we are in the Explorer
00:10:15 Next to that, we have the Workflow Perspective, Editor Perspective, and UI Designer
00:10:24 Measure of the screen is the current perspective, which we have selected,
00:10:30 and finally below the horizontal gray bar is the status bar. Now we'll see how to capture the
00:10:41 To capture the application, we have to create the project first. So click on File, click New Project.

00:10:49 Here, one popup will open. Give the name of the project,
00:10:54 I will give initialDeclaration... Select the project template.
00:11:07 By default, it's the project SAP iRPA version 1.0. Apart from that, we have Project v3 and v2.
00:11:15 Project v3 and v2 is mostly for the older version of the projects.
00:11:22 We will select the default one, that is project SAP iRPA version one.
00:11:28 Next we have the title. I will give the same title as the project name.
00:11:32 You can give a different name as well. Client. Client is you have to provide the name of the client

00:11:39 for which you are creating the project. I'm giving the name here SAP.
00:11:45 Next we have the version. Version, by default is 1.0,
00:11:49 as we are creating the project for the first time. Next we have the date, which is the system date.

00:11:54 Here we have the location where the physical file of the project will be stored, Here we have the
location where the physical file of the project will be stored,
00:12:03 and then we have Browse button. You can click on the Browse button
00:12:08 and select some different other locations where you want to store the data.
00:12:14 Here I'll make it cancel because I want to keep the default location.

00:12:18 Once all of these values have been provided, click on Save. Once you click on Save, it will
generate some default files
00:12:28 which are needed to continue our project. Similar like in the workflow,
00:12:33 global and popups has been created. All the SDK file has been added in the script and so on.
00:12:42 I will come to the Explorer Perspective to capture the application.
00:12:46 Once you click on the Explorer Perspective, you will see one application panel.
00:12:51 The application panel is a place where all the applications which have been declared will be
listed here.
00:12:59 To capture an application, you have to make sure you have kept the application open in your
00:13:05 So first, I want to capture one Windows-based application, that is an application developed
00:13:11 using the Windows Forms technology. To start the application capturing,
00:13:17 first I will open the application in my system... So, I will keep the Sample CRM application open
in my system.
00:13:30 I will go back to my Desktop Studio, and I will show you how to capture this application
00:13:36 and declare all the necessary pages and items. To capture the Sample CRM application,
00:13:44 you have to right-click on the Applications panel, select Add a New Application.
00:13:51 Once you select Add a New Application, one popup will be open and here we have the options
to select the technology.
00:13:59 By default the technology is WEB, but the application which I'm going to capture now
00:14:05 is a Windows application, so I will click in the small dropdown button. I will select WIN.
00:14:13 Once I select WIN, all the application which is related to Windows technology will be listed here.

00:14:20 From the list, I will select Sample CRM, because this is the application which I want to capture.
00:14:28 Once I click on Sample CRM, you can see the application screenshot
00:14:32 present in this window. In the right-hand side corner, we have two options,
00:14:39 Print Window, Capture Screen. By default, we'll select Print Window.
00:14:44 Once you have selected all the necessary options, click on the Select button.
00:14:50 Here it will give you the popup to rename the application or change the file locations where you
want to store
00:14:58 the physical file of this project. I will keep both of them the default value.
00:15:04 Once you are done, click on Save. Here it will come in the Applications Panel,
00:15:12 and the application name is SampleCRM. On the right-hand side, we have the related
00:15:19 which is for the SampleCRM application. Here is the name.
00:15:24 Here also if you want, you can rename the application. Driver is the Pil Win.
00:15:31 Along with that, some other value. Next I will capture the page for this application.
00:15:37 To capture the application, we will click, either you can double-click on the square box,
00:15:43 or you can right-click on this particular application, and select Capture A New Page.
00:15:51 I will opt for the first one, so I will double-click on this particular square box.
00:15:57 Once you double-click, one popup will open with the title Capture Page.
00:16:01 There we have two options, Capture and Edit, and Capture and Continue.
00:16:06 Capture and Edit will give you the options to rename the page, along with some advanced
00:16:13 Capture and Continue will provide you with the default page name along with the standard
00:16:19 If you want to close this window, you can click on Cancel.
00:16:24 Here we have the options to choose technology. As this is a Windows application,
00:16:29 so by default WIN has been selected. Next to that we have the Browse button.

00:16:35 If you click on the Browse button, it will enlist the page of this application.
00:16:40 Alternatively, you can go back to this application and press Control. This will highlight the
00:16:50 as well as giving you the pages which are present in the application.
00:16:57 So, once you selected the correct applications, if you click on the page,
00:17:03 it will show you a screenshot of the current page. Once it has been done, click in Capture and
00:17:13 So here, by default, the page name is pPage. I want to rename it to psampleCRM...
00:17:29 And start, click on Start Capture. Once you have captured,
00:17:36 it will give you the screenshot of the page. As long as pSampleCRM is present
00:17:42 under the SampleCRM application. It has now marked it in red,
00:17:50 and this is the capture data, which has been captured by the Win Application driver
00:17:57 for SAP Intelligent RPA. You have to select certain values as criteria
00:18:04 from the captured data to identify this page uniquely during runtime.
00:18:12 To select the criteria from the captured data, either you can double-click on the captured data
00:18:19 or you can right-click on that and select the Add to Criteria option.
00:18:26 Here I'm going to select TITLE as a criterion for this page, so I will select Add to Criteria.
00:18:34 Once I select Add to Criteria, it will be enlisted in my criteria button.
00:18:42 We have some options here as well. Either you can select Complete Sample CRM as my title,
00:18:50 or we can select part of the text. I will not change it here or anything.
00:18:55 Once the correct criterion has been selected, it will be marked in green.
00:19:01 Now we have three options to see the screen, tree, or both.
00:19:06 Screen will give you the screenshot of the page. Tree will give the complete DOM structure
00:19:13 which has been captured by the respective driver, and Both will give you two parallel views.
00:19:22 One is the screen along with the DOM structure. So this is the first page we have captured
00:19:31 for our sample CRM application. Next we will declare one item.
00:19:37 I want to write some value in my contract ID, so this contract ID input box,
00:19:43 I have to add it as an item in my application. To do that, we can select that particular input box,
00:19:53 and right-click, and select Associate to New Item. So once you click Associate to New Item,
00:20:01 one item will be created. Here, in the Parameters panel, you can rename it,
00:20:07 so I will rename it to edContractID. The rest of the parameters value I will keep unchanged.
00:20:20 Capture data, it has captured or provided certain values for this particular item.
00:20:27 You can select any of them or a combination of them, as criteria to uniquely identify
00:20:35 this particular item during runtime. I will select IDENT = 2000.
00:20:42 So this time I will double-click, and it will add in my criteria value.
00:20:48 Here you can see IDENT has been identified, and here the item has been changed to green,
00:20:56 and this particular textbox also is marked in green. Next I will...
00:21:06 Next, I will add another item, which is the Search button. Either, in the same way, you can select
from the screenshot,
00:21:16 right-click, and associate with a new item, or you can come to that DOM tree,
00:21:24 and you can select the item here, and associate with the new item.
00:21:30 You can do it either way. So I will select the item from the DOM structure here.
00:21:37 I will click on the associate to new item. Once I do that, it will add an item here.
00:21:44 I will rename to btSearch... The rest of the parameters value I will keep it unchanged.
00:21:54 Once I have done that, I will add the criteria for this particular button.
00:22:00 In a similar way, here I will select TITLE = Search. I will double-click, and it will be added

00:22:07 in my Criteria panel. Next I will define another item, that is name,
00:22:13 so I have selected the input box, right-click, and Associate to New Item.
00:22:22 And I will rename it to edName. Once it has been renamed, I will come to that item,
00:22:33 and I will select IDENT. Once it has been correctly identified,
00:22:39 the identify area will be marked as green, as well as the item name.
00:22:45 So this is the first Windows application we have captured, captured our application SampleCRM,
then pSampleCRM page,
00:22:55 and next to that, we have created three items. One is for the contract ID input box, one is the
00:23:03 and next is the input box for the name. Now I will show you how to capture a WEB application.
00:23:12 In a similar way, I have to make sure my WEB application is open in one of the browsers.
00:23:18 Supported browsers are Internet Explorer, Mozilla Firefox, and Chrome.
00:23:23 I will prefer Internet Explorer, so I will go to my system...
00:23:37 Here I have kept one webpage open in my Internet Explorer. I will capture this webpage from the
Desktop Studio.
00:23:46 So I will go back to my Desktop Studio again.. I will right-click in my Applications panel,
00:23:59 Add a New Application... I will right-click in the Applications panel,
00:24:06 Add a New Application, and this will, in a similar way,
00:24:12 will show me Capture Application. So here the technology, I will select WEB,
00:24:17 as I want to capture a web page, and I will select the application which I want to capture.
00:24:25 Here help.sap.com is the web page which I want to capture.
00:24:31 Once I click on that, it will show the screenshot of the current page below,
00:24:36 and if everything is fine, I'll click on Select. Here I can rename the application,
00:24:43 so I will make it HelpSAP, and I'll click on Save.
00:24:54 So one new application has been added in my Applications panel.
00:24:58 To capture our first page, I will right-click on the application,
00:25:03 and capture a new page. Here the technology has been selected as WEB.
00:25:09 I will click on Browse... Once you click on Browse,
00:25:24 it will give you the applications page, different pages. I will select help.sap.com, and click
Capture and Edit.
00:25:35 So here you can also rename it, I want to keep the default name, and click on Start Capture.
00:25:43 It will capture the underlying DOM structure by the SAP Intelligent RPA driver,
00:25:52 which is responsible for the WEB applications, and when it has been captured completely,
00:25:59 it will show you in your application panel. So here you can see the complete page has been
00:26:08 Here is the complete DOM structure, with all its elements, and this is the capture data for this
particular web page.
00:26:18 I have to select one criterion for this web page to identify this page uniquely during runtime,
00:26:25 and I will select SAP Help Portal, along with data URL. I have double-clicked both,
00:26:33 and it will make an "and" condition, whenever it will try to match this condition,
00:26:40 so it will check that the title is SAP Help Portal, and the URL is the URL which I have mentioned.

00:26:48 So here is the first web page we have defined in our web application.
00:26:54 Next I will define an item to write some value in the search box.
00:27:00 I will click here. Immediately it will be in the blue box,
00:27:06 and the respective DOM structure has been also marked in our DOM tree.
00:27:13 I will right-click, associate to a new item, and it will add an item here.
00:27:20 The item is oSearchKeywords. I will not change the name.

00:27:25 By default, one criterion has been added, and that is unique to identify this element during
00:27:34 so I will not do any changes here. Next I will identify another element,
00:27:43 which is the Search button, so I will click on that, right-click,
00:27:47 Associate to New Item. Here, another item has been added in my item panel,
00:27:55 and I will select here one... I will select criteria for this oINPUT item
00:28:07 from my Capture Data, so I will select the type is submit. Now I can say it is green,
00:28:15 both the item and the identified area, which is green now. I'll rename this item from my
Parameters panel
00:28:24 to oSearchButton... So this is another web application which we captured here,
00:28:40 that is the SAP Help Portal. Within that, we have defined our first page,
00:28:45 and first page we have identified two items. One is the input box where we can write some
search values,
00:28:53 another is the Search button. That's all for week two, unit one.
00:29:00 In the next unit, I will explain about advanced declaration. Goodbye.

Week 02 Unit 02

00:00:05 Hello everyone and welcome back to week two, unit two. In the last unit, we saw how to declare
an application,
00:00:17 but sometimes we need advanced mechanisms to ensure that the applications are properly
captured and recognized.
00:00:26 In this unit, we will learn how to declare applications in advanced use cases.
00:00:34 During the solution design phase, we define the various application pages... and item entities
required by your project.
00:00:50 Once we have created an entity, our main task is to set its recognition criteria.
00:00:58 Desktop Studio and Desktop Agent use recognition criteria to link the entity with the targeted
00:01:06 component of the real-world application to be controlled. If the screen that is to be controlled
does not have
00:01:13 unique, distinguishing properties, we can use an advanced declaration and recognition methods.

00:01:22 Let's see what available advanced declaration methods depend on the technology.
00:01:30 First, we have the Must Exist method, which is available in all technologies.
00:01:36 It finds one or more components that are present in the screen to be interacted with.
00:01:42 But not in others. These components are declared as items
00:01:48 on the page, and their Must Exist parameter is selected. Using this method, our screen is
recognized as a page
00:01:58 if the screen matches the page criteria and all Must Exist items are found on the screen.
00:02:05 Next, we have the Must Not Exist technique. The Must Not Exist method is only
00:02:12 available for the WEB and UIAutomation technologies. It finds one or more components
00:02:19 that are not to be present in the screen to be interacted with, but are present in others.
00:02:26 These components are declared as items on the page and their Must Not Exist parameter is set.

00:02:33 Using this method, a screen is not recognized as a page if one of its Must Not Exist items is
found on the screen.
00:02:43 To declare a Must Not Exist item on a page, first capture the page and add the page criteria,
00:02:51 then add the Must Not Exist item and select its Must Not Exist parameter. Next, another useful
and interesting technique is Occurs.
00:03:06 This is available with WEB and UIAutomation. When similar items appear multiple times on the
00:03:15 then we select one item and add the criterion which is consistent with all the similar components,

00:03:22 and select the Occurs parameter. When we select the Occurs parameter,
00:03:28 then the respective connector assigns index values for each of the items starting from zero.
00:03:35 We can access those components using the
index value. Pattern next – we have the pattern techniques.
00:03:49 The item pattern method consists of recognizing a set of related components rather than a single
00:04:01 These components must be linked together by a parent-child relationship. This method is useful
when the target component
00:04:10 has no unique, distinguishing properties. Suppose a Web page has several TABLE components.

00:04:28 We want to target the TABLE component that has the component header Date.
00:04:36 We can define the following components pattern by, first, adding one component – the target
component –

00:04:45 that recognizes the TABLE component and then adding a child component that recognizes the
TH component
00:04:53 that has the Text property equal to Date. The depth of the relationship between recognized
00:05:02 can be set with the Children checkbox. If it is checked, the component recognized must be a
direct child of the component recognized
00:05:18 as the parent in the pattern. We can select Occurs if it is a collection of data.
00:05:25 We can change the target component by selecting the Target parameter. The targeted item will
be bold.
00:05:37 The ancestor method searches upwards in the hierarchy to find an ancestor component with a
set of
00:05:44 properties that make it unique. This ancestor component cannot be part of the ascending
00:05:52 that is incorrectly recognized. With this method, we need to first declare an item that targets this
ancestor component,
00:06:01 then set this item as an ancestor of your item when you set item parameters.
00:06:11 Finally, we have the Labelled by method, consisting of finding another component that is
00:06:17 at a fixed distance – CX and CY – from the targeted component. Desktop Studio stores as a
00:06:27 the distance between the targeted component and the label component. This distance is
calculated in a unit
00:06:35 independent of the screen resolution. Next, I will go for a system demo,
00:06:42 where I will declare an application in the advanced methodology. I have opened my previous
project which I have created in our last unit.
00:06:52 Here, I will show you how we can use the advanced mechanism to declare applications.
00:06:58 So first, I will add a new item which indicates the Welcome to the SAP Help Portal words.
00:07:09 I'll rename it to WelcomeNote and add the criterion, which is Text = Welcome to the SAP Help
00:07:21 So once I have added a new item on our page, I will select the Must Exist condition, as I ticked
from my parameter list.
00:07:31 Once I select the Must Exist item, Desktop Agent, during the runtime, will make sure
00:07:37 the page criteria should be fulfilled, along with that, the particular screen has this particular item
00:07:47 So this is where we can use the Must Exist conditions. Next, I will show you how we can use
00:07:57 To show you how to utilise Occurs technology, I will go back to my SAP Help Portal
00:08:05 and I will do the searching with the rpa keywords. Here, you can see multiple results have been
00:08:13 once I search with the word rpa, and for the automation purpose,
00:08:18 I want to read each of the search results one by one. As we know, this search result number can
vary from zero to n.
00:08:29 To identify each of the elements uniquely during the runtime, we can utilize the Occurs
technology during application declaration.
00:08:38 Let's come back to our Desktop Studio and capture the page. To capture the new page, I will
select the HelpSAP application,
00:08:48 where I click on that and Capture a New Page. Click on Browse.
00:08:54 This will return me all the Web applications which are present in my system,
00:08:59 and from there, I will select help.sap.com, and I click on Capture and Edit.
00:09:06 I'll rename the page to pSearchResult... and start capturing. This Start Capture will return me the

00:09:19 complete DOM structure of my current SAP Help Portal page. There, we will see how we will
utilize the Occurs technology.

00:09:28 (Capture Page count increases slowly.) So it is capturing all the elements which are present on
my current Web page.
00:11:27 Once it is done, it has returned me the page structure. So here, I will define the criterion for the
00:11:37 That is TITLE. Once it has been done, I have to add items to read the search result
00:11:45 which is present on my screen. So, first I will select the first search result.
00:11:56 To do that, I will select the DIV, which returns
00:12:02 me the whole container for this result, for the first search result, I will add a new item,
00:12:11 and I'll rename it Searchvalue. Now I will define the criteria for this item,
00:12:25 so I will select class and my criteria, and by default, id has been selected.
00:12:34 But when we are using the Occurs technology, we have to make sure we are not selecting any
static value
00:12:42 which is specific to that particular item. So I will remove the ID which is specific to my first search
00:12:51 To remove the item, I will select that and click on the minus button. And here, I will select
00:13:01 Once I select Occurs, it will highlight all the similar items which fulfill the criteria conditions.
00:13:09 This is the way we can use the Occurs technology, and at the same time, if you see the DOM
00:13:18 here you can see all the elements with oSearchvalue, which has been highlighted. Along with
that, all the items have been assigned an index value.
00:13:29 Later, we will see how we can access all these items using the index value. So this is how the
Occurs technology works.
00:13:39 Now, I will show you how to use patterns in criteria. Now, we have in this particular item,
00:13:50 we have defined DIV, along with the class as the criteria. Now, if I want to add pattern as well in
this particular criteria list,
00:14:03 I can select the DIV which is at the top of that and right-click on that, and add as a new
component in the pattern.
00:14:13 So it will add that particular DIV in my criteria. So here, it will highlight only those items which are
present in this particular DIV.
00:14:29 Now, once you have added pattern technology, there you will get the options which is the target
00:14:37 Whether the target element is the parental DIV, or the target element is the child.
00:14:44 Here, you can see by default the target element, which is my child item.
00:14:52 So... here you have the options to select whether you want to target the parental DIV
00:14:59 with the pattern criteria or you want to target the child DIV or child item in the pattern criteria.
00:15:21 Now, I will define another item in my list, which is the... name of the... search result.
00:15:32 So I will associate this item... with the new one and rename it to btsearchName.
00:16:03 So, once you have defined one item, this is getting highlighted.
00:16:07 Instead of searching the text which is specific to this particular item, I will select range and I will
remove the text here,
00:16:22 as well as selecting Ancestor from my parameter list. So I will say oSearchvalue is the ancestor
of the SearchName.
00:16:35 So here you can see the respective search name has been highlighted.
00:16:41 So each of the search results has one search name, and whichever search result we select,
00:16:50 that respective search name will identify that item. This is the way we can select our ancestor
00:17:06 Next, we have the options to capture multiple screens within the same page. To do that, here we
have a small camera icon,
00:17:28 which we can select. Here, you can browse in a similar way to the previous one,

00:17:35 select the right page, and click on Capture and Edit. Once you start the capture,
00:17:44 it will capture the DOM structure of the page. (Capture Page count slowly increases.)
00:19:37 Once this popup comes, we have to select No. So, if I select No here...
00:19:48 you can see two screenshots have been captured, and they have been indexed at the top,
00:19:57 and both have their own DOM structure which has been captured. So this is useful when the
criteria of the pages are same
00:20:05 but the underlying result is different. If we get a multiple search result or multiple pages in this
search result
00:20:14 at that particular point in time, we need to capture each of the pages separately,
00:20:19 which contain different search values. That way, we can utilize the multiple capture.
00:20:26 Next, I will show you how we can use Labelled by technology. To use the Labelled by
technology, I will come back to my SampleCRM application.
00:20:38 There, we have defined three items already, which are a ContractID input box, btSearch button,
and Name.
00:20:50 Now, for the Contract Id and Name, we have defined indent as a criterion.
00:21:04 But that indent may get changed if the underlying DOM structure has some changes. To make it
most robust, we can utilize the respective level to identify the input box.
00:21:19 Let's see how we can do it. To utilize that, I will add one item,
00:21:26 which indicates the first name label itself, so Associate to New Item.
00:21:35 I will rename it to FirstName and select the criterion as TITLE = Firstname.
00:21:48 So, I have defined the stFirstName item, which is highlighting the Firstname level.
00:21:55 Now I want to identify this particular input box which is next to my first name.
00:22:04 So I will Associate to New Item, rename it to edFirstName,
00:22:15 and say this is labelled by stFirstName itself. And here I will select the criterion as an Edit.
00:22:30 So, whenever Desktop Agent searches for edFirstName, it will check whether this particular item
00:22:39 Labelled by with stFirstName or not. So this is the way we can use the Labelled by conditions
00:22:46 to identify the elements. That's all for week two, unit two.
00:22:54 In the next unit, I will guide you on how to create the workflow. Goodbye.

Week 02 Unit 03

00:00:07 Hello everyone, and welcome back to week two, unit three. In the last units, we learned how to
declare applications.
00:00:17 In this unit, we'll see how to use these declared applications to design business workflow...
00:00:31 So the second part of the development phase is workflow design. Workflow design is to design
automation sequence
00:00:38 from the functional or business requirements using the applications, pages, and items
00:00:44 declared in the Explorer perspective. A context data structure for storing data,
00:00:50 a set of functional activities such as Get, Set, Click, and so on,
00:00:54 a generic comment activity for describing functional requirements...
00:01:05 Here are four components which help us to create automation process from business
00:01:12 We have functional descriptions. When we design workflow, we functionally describe the
automation sequence
00:01:19 for implementing the sequence of screens and actions to perform on each of the screens.
00:01:26 Then we have activities to define the actions on that data to collect and return.
00:01:37 Next, we have code generation. At any time, we can generate the JavaScript code
00:01:45 from the workflow. This generated code contains the scenario declaration,
00:01:50 the steps implementation, some code for each included activity,
00:01:55 and a comment associated with each comment activity, which helps the script developer.
00:02:01 Sometimes workflow design and the respective generated code is not enough to automate the
business requirement.
00:02:09 At that time, we need Script Developer to modify the generated code...
00:02:19 Workflow has two parts: From a functional perspective, it is a sequence of pages and activities.

00:02:26 And from an implementation perspective, it is a scenario which contains one or more steps.
00:02:35 In workflow design, flowcharts are used to describe the sequence of pages or navigation of
00:02:42 in the automation sequence, whereas activities in the page level are used to describe
00:02:52 the sequence of automation actions which need to be performed on a page.
00:03:00 Below are the steps to associate with the workflow design. First, create a workflow.
00:03:06 Then, design workflow, the set of activities, and finally build the workflow to generate
00:03:13 the respective JavaScript code. Each of them we will see in detail.
00:03:21 Here we have the Activities panel which has two sections: The first is Pages, which contains all
the applications and pages
00:03:31 defined in the Explorer perspective during application declaration.
00:03:37 Next is the list of available activities grouped by category such as File activity, Outlook activity,
and so on.
00:03:47 Each activity can be dragged and dropped into the current design panel.
00:03:54 Another important part of the workflow design is context. Context is used to store data.
00:04:00 It is made of folders and items. Context can be autogenerated
00:04:05 depending on the workflow setting. You can use this context later
00:04:10 to do calculations, data manipulations, and so on. Next I will guide you through how to create
00:04:16 our first workflow and describe in more details. I will go back to my system
00:04:22 to show you how to declare the workflow... So this our workflow perspective, where we have
00:04:40 GLOBAL, POPUPS, and applications defining my workflow panel. Here we can create the
workflow depending on the application

00:04:54 segregation, or if multiple applications are involved in a single workflow, we can create under
00:05:01 Next is the properties. Properties get updated depending on the activity panel.
00:05:06 Whenever we select an activity, respective properties have been generated.
00:05:11 Next we have the context. Context is a place where we declare the data items.
00:05:17 It can be in folder and item structure. Context can be autogenerated,
00:05:23 or context can be manually defined. Next we have Activities and we have Pages.
00:05:30 Pages is a place where we defined the applications in my previous steps, and Activities
00:05:36 are grouped by category. Here you can we see have the category for Outlook library.
00:05:42 Next we have the Error list, where we describe all the errors during the build time.
00:05:50 Next I will show how to create the first workflow. So come to SampleCRM application,
00:05:58 do right-click. It will give you the popup. Rename is to the workflow which you want to create
00:06:06 I'm giving the name CRMAutomation. Click on the Save button.
00:06:15 It will create a new panel. This is known as the workflow panel.
00:06:19 And here is the flowchart. It starts with the Start icon.
00:06:23 You can expand the flowchart according to your needs. Now I will come to my activities and add
the first activity
00:06:33 to start the application. So I will get it under the application category, drag and drop
00:06:39 the activity in my active workflow panel. You can position it properly using control arrow key,
00:06:49 or you can move it using your mouse. Now I will come to my properties of this activity.
00:06:59 Here I have to select the application which I want to start, so I have selected here SampleCRM.

00:07:09 Now I will come to pages where I have defined the pages. I will drag and drop the page which is
for the SampleCRM
00:07:18 I have defined in my previous video. I will connect from start application to that particular
00:07:26 page to make the automation sequence understand what it needs to execute after the Start
00:07:33 I will go and select the properties. Here you can see how certain properties have been selected.

00:07:40 You can double-click on the page and maybe get to the page viewer.
00:07:45 Here you see the CRMAutomation pHome management. And properties activities get updated
00:07:52 according to the page view. I will go to the Item - Get category...
00:08:02 And I will go to Item - Set category and select Set activity, and drag and drop
00:08:09 to my Context ID text box. Here you can see on the right-hand side, certain properties
00:08:16 have been selected, and the item name is edContractID. I will set source data as a "5" now in
double quotes
00:08:25 to set the value in that particular one. Next I will click, or right-click, on the search button.
00:08:31 I will select Click on the Item. And it will add one automation sequence
00:08:41 in my left-hand panel, and my right-hand panel properties have been updated.
00:08:46 Now I will save using the control list. I'll go back to Context.
00:08:52 Here you can see nothing is there. If you go to Settings, Workflow window,
00:09:02 there are options to generate the context item. If you select it and save,
00:09:08 then if you drop any Get activity on any of these items, then certain contexts get autogenerated.

00:09:16 So I am doing a Get activity in my name. And here you can see context has been generated.
00:09:23 And this is dependent on the application name, page name, and then the item name.
00:09:30 I can repeat the steps for another item. I will select "Get" and drop it for my first name one

00:09:40 and, in a similar way, the item has been generated. We can create the context manually as well.

00:09:50 So if you want to create it manually, you can go back to workflow.

00:09:57 You can unselect the box and save it. Now, I will go and put a "Get" activity in my ZIP code.
00:10:10 And you can see, no context has been generated. To manually create the context, go to
00:10:19 and here you write the name of the context which you want to generate.
00:10:26 So this is the place where you have to mention. once you write the name, you can press Enter
00:10:34 So I am writing it as a SampleCRM.pHome.zipCode
00:10:50 and I'll press Enter, and I'll go back to my context, and here you can see our folder structure
00:10:58 has been created, named SampleCRM. Within that one, another folder, pHome,
00:11:08 and finally we have the zipCode context item. So this is the way we can generate the context.
00:11:18 Now if I drag and drop any item to my particular context item, one Get activity also
00:11:27 generated in my left-hand panel Activities. So I will go to Properties and I will see
00:11:34 it has been stored in my first name. But this is not my desired result where I want to store.
00:11:42 So, I can modify it. I will first go back to my context, manually I right-click
00:11:49 on SampleCRM, or pHome, and create an item. Double-click on that and rename to "address".
00:11:59 So this is another way to create the context manually. And I will go to Properties, and from the
00:12:08 I will select my new item, which I have created in my previous tab.
00:12:18 So this is the way you can change the name of the context item as well.
00:12:25 So here, all my Activities have been done. To make it a little smart, we can add
00:12:32 certain delays also. Here is another part, we have the array.
00:12:39 So in my right-hand side panel, there is a small checkbox. If we select it, it will make
00:12:45 the item as an array, which can store a set of values. So if we're reading some table data
00:12:51 or multiple values, we can make it checked. Next to my screen, there is another tab
00:12:58 that is Generated Code, and it shows whatever code has been generated for this step.
00:13:04 This does not show my previous code which is for the other activities.
00:13:09 This is only for the saved version of this particular page activity.
00:13:15 If you don't save, the generated code will not be updated. So... here.
00:13:33 To make my workflow a little bit smart, I will add some delay activity here.
00:13:40 If I drag and drop the delay activity in my work page viewer,
00:13:50 it will add a certain wait in that particular item. So here I can see on left-hand panel
00:13:56 when delay activity has been added. And if you come to Properties, it will...
00:14:01 You can update the delay time, it is in milliseconds. So instead of 1000, you can change the
00:14:09 I'll update to 2000 milliseconds, that is actually two seconds.
00:14:14 Now once the sequence of activity has been generated, we can move up and down using the
00:14:22 So I have moved it to top. Now this delay is the starting delay, so whatever the condition is,
00:14:30 it will wait for two seconds. So to make it a little more smart,
00:14:38 I will add "Wait Until". So this will check certain conditions to get true.
00:14:43 Once the conditions are getting true, it will perform the rest of the activity.
00:14:49 So in that case, I'll have to make sure the rest of activities are under "Wait until true" conditions.

00:14:55 So if these particular conditions get true, only then will the rest of the activities will be performed.

00:15:01 Otherwise not. So I am moving my activities here and there,
00:15:06 using my mouse click, and I will go back to my "Wait until true" conditions,
00:15:14 and there I will write $item$.exist
00:15:23 and it will generate a pop-up below that, from there I will select my item, ContractID.
00:15:33 So it will wait for the ContractID to reappear. These steps need to be performed
00:15:39 because sometimes the application takes some time to upload, or some pages need some time
to get refreshed.
00:15:47 To make sure the automation sequence is running properly, we need to provide the proper wait.

00:15:53 So I will come back from my page activity to my workflow activity,

00:15:59 and here you can see the complete workflow. Now a final step, I will add another message box
00:16:07 from my pop-up activity, and it will give me a message box here.
00:16:13 I will make it in proper sequence in the properties panel. I will give certain values for the
necessary parameters,
00:16:22 whatever parameter value is mandatory. It is marked as red unless/until you provide the values.

00:16:29 So I will provide name, title, and the message I will give is "Execution successful".
00:16:37 And next we have the Wait Closing checkbox. I will make it checked, so unless I'm closing the
00:16:44 the workflow will not be completed. So let's build this one.
00:16:51 So, to do that, I have clicked on this icon or you can press Ctrl+B as well for the shortcut key.
00:17:03 So it is getting built, and necessary codes or JavaScript codes are getting generated
00:17:10 from this automation sequence in my editor. And here you can see in the lower Output panel,
00:17:19 there are zero errors and zero warnings, which I have highlighted.
00:17:25 So that means the build is successful, now I will come and click on the execution button,
00:17:32 and one debugger point will be opened up, here certain events have been triggered
00:17:37 and I have an icon in my sys tray. So I will select TestCRMAutomation,
00:17:44 which is my workflow, and it will open up the application, write the value "5"
00:17:49 and then the search. So my first workflow execution is successful.
00:17:56 Now I will show you certain other conditions which we can apply in our workflow design,
00:18:05 such as "If" conditions. So, first we can see how to go back
00:18:14 from workflow to my generated code. So once you click on that particular workflow activity,
00:18:22 so here I can do a right-click, "Goto Code", and it will let me do the JavaScript code
00:18:30 generated for that particular activity. Similarly, from the generated code I can do the right-click,
00:18:39 and here I can go back to my workflow design. This is the part where I can come back.
00:18:51 So this is the way it works. We can navigate from workflow to generated code
00:18:56 and generated code to the workflow. But if we write any code manually,
00:19:01 that reverse engineering does not perform here. So manual codes cannot be navigated to the
00:19:08 unless/until we do our connections. Now I will define how to use the "If" conditions.
00:19:15 So for "If" category, we have "If start". I have dragged and dropped here.
00:19:21 This is a condition panel - you can select either item or data depending on your condition.
00:19:28 Here I will select $data$ to find out if a context value if blank or not.
00:19:35 If it is blank, I will not perform certain actions. So here, I am dragging and dropping
00:19:43 some actions here, some items here. I am checking if it is not equal to blank,
00:19:50 only then will I perform certain actions. So I have added the conditions,
00:19:57 and next I will add a "Get" value with my address. So this is the way you can use

00:20:07 "If" conditions in your workflow. Optionally, you can add the "Else" condition as well.
00:20:15 So here I am selecting my data from my dropdown, pHome and address.
00:20:28 So this has completed my "If" conditions. Now I will go back
00:20:44 and add an "Else" condition. "Else" conditions will come under the "If"
00:20:48 so if it is not true, then it comes back to my "Else". Now I will delete that - to delete any item,
00:20:54 you can right-click on the activity and it will give you the pop-up,
00:20:58 "Do you want to keep the content?" If you select yes, it will keep the content,
00:21:02 and if you select no, it will delete all the content which is under that particular activity.
00:21:11 So this has been done here. Now I will...
00:21:29 I will add a "Wait for Click" event to generate how to perform a click on the search button,
00:21:48 and I will add a "Get" activity again so it will wait till the manual click
00:21:54 has been done here, and otherwise it will not perform the "Get" activity.
00:22:01 So I will navigate back to my main workflow where I have created a sequence
00:22:08 of activity here. And that's all for today's demo.
00:22:19 In the next unit, I will guide you on how to design more complex use cases.
00:22:25 Thank you, goodbye.

Week 02 Unit 04

00:00:05 Hello everyone, and welcome back to the fourth unit of this week.
00:00:09 In this unit, I will guide you through how to develop advanced use cases.
00:00:16 Workflow design is a part of the development phase. In my previous unit, you have seen
00:00:21 how to develop a simple workflow. In this unit, we'll discuss
00:00:27 the different advanced mechanisms available in SAP Intelligent RPA Desktop Studio
00:00:34 and how we can utilize them. So as an advanced mechanism we have loop pattern.
00:00:42 It has three parts. One is the start loop, exit loop, and loop next.
00:00:48 Next we have the switch pattern. Again we can utilize the wait multiple
00:00:53 or switch output. Then we have reuse step pattern,
00:00:58 where we can reuse already-build steps in some other workflow
00:01:03 so that it will reduce our rework. And finally, we have the out of scenario pattern,
00:01:09 where we can develop global code. We will see how to build workflow
00:01:17 using each of the mechanisms in my system demo. So let's go for the demo...
00:01:28 Let's see how to use loop. In our previous unit, we have defined a HelpSAP application,
00:01:36 which has one of the items to read the search result, and along with the search result name.
00:01:44 Now we will see how we can read this data. Come to Workflows.
00:01:50 Create a new workflow for that. I will rename it LoopExample.
00:01:57 Click on Save. This will create the workflow and flowchart for me.
00:02:05 Add the activity first. That is pHTTP homepage.
00:02:12 Connect with the Start activity. Go inside this page.
00:02:18 Add a set activity here and give the name RPA... R-P-A. Next add Click activity in the search
00:02:34 Click on the item. Save it and come to the loop example flowchart.
00:02:41 Come to activities from loop flow category select the Start loop activity.
00:02:51 Connect with the previous page. Next add Exit condition.
00:02:59 Connect with the Start loop activity... And Exit loop,
00:03:09 you have to add an exit condition here. So I want to end that particular loop
00:03:16 when a normal search result is present in our page. To add this condition, click on the item,
00:03:26 select HelpSAP, then select the page name. That is pSearchResult.
00:03:32 Within that, select the item. So when this particular item
00:03:36 does not exist, the loop will end. Let's make it a little better...
00:03:52 And then I will come to my pages. There I will drag and drop the pSearchResult page,
00:04:03 connect with my Exit loop... Now come to Context and create some context here.
00:04:13 First will be the search result, which contains multiple search results in our page,
00:04:19 and next we have the search name, which will contain the name of the search result.
00:04:25 Now in a single page we have multiple search results, so I have selected the array.
00:04:33 Now again come back to Activities and drag and drop Loop to the start block.
00:04:42 Connect with my previous step... So whatever is between Exit loop
00:04:51 and Loops to the Start block, those steps will execute multiple times.
00:04:57 Once these steps have been executed, it will come to Loops to the Start block.
00:05:03 It will come to the start. It will check whether the exit condition
00:05:07 is getting fulfilled or not. If they are fulfilled, then it will end the loop.
00:05:11 Otherwise, it will perform the next steps. Let's save it.

00:05:17 I will click, I will traverse to the pSearchResult management page...
00:05:27 And here I will add a Get activity for each of the search results.
00:05:33 So come to item Get... Drag and drop it here.
00:05:44 And from the data, I will select the item where I want to store it.
00:05:52 It is pSearchResult and, within that, searchName. Click on Control+S,
00:06:01 and I will go back to my loop example flowchart, and the complete loop example
00:06:10 looks like this. Let's build the code first...
00:06:18 So build is successful. Here you can see "Workflow generation completed"
00:06:22 with zero errors and zero warnings, and the loopexample.js file has been generated
00:06:27 in the editor perspective. Now I will double-click on this JS file
00:06:33 and see what the code looks like. This is the scenario that has been generated
00:06:39 by the workflow generator. The first step is to set the value in RPA
00:06:46 and click on the search button. Once it is done it will come to Start_loop activity.
00:06:52 The Start_loop activity is initializing one of the variables, that is sc.localData.Startloop = 0.
00:07:01 So this is the index of the loop. Next it will come to the Exit loop step,
00:07:08 and here it will check whether the exit condition is getting fulfilled or not.
00:07:13 If it is getting fulfilled, then it will make sc.localData.Startloop = -1
00:07:20 and end with the NEXT_LOOP tag. Otherwise, it will come to Else condition,
00:07:28 and it will create a new data item. After that it, will come to pSearchResult management,
00:07:37 which is the page level activity, and here it will get the data for that ptSearchName
00:07:46 with the sc.localDataStartloop index. And store it in SearchResult.searchName.
00:07:56 As we know, SearchResult is an array, so here the same index with the loop has been used.
00:08:04 Next it will come to Loop_to_the_Start block. If loop to sc.localData.Startloop is not equal to
00:08:12 then it will increment the value. Else, it will end the step.
00:08:18 This is what the loop code looks like, and these are the scenarios which have been generated.
00:08:26 So this is all about the loop example. Next I will show you how to use the Wait multiple activity.
00:08:37 I will come back to my workflow. The Wait multiple activity gets used when two different
00:08:46 pages can appear depend on the condition. One such example is, sometimes we can get login
00:08:57 or, if we are already logged in, we can directly go to our home page.
00:09:04 So let's see how to use wait multiple. Create a new workflow.
00:09:11 Name it WaitMultiple. Click on Save.
00:09:20 Here in the Activities panel, we have the Wait multiple activity under the Flow category.
00:09:28 Drag and drop it here. And let's say that, by default, we are supposed
00:09:34 to get our home page. But if we have already done some searching
00:09:40 from our previous step, It may end up with the search result page as well.
00:09:47 So, by default, I will say Wait multiple, and if I connect my home page, SAP search home page,

00:09:55 it will come as a default branch. If it is here.

00:10:00 If it comes to my home page, I will navigate to my page. I will set some value in the search
00:10:10 and here I will add the keyword "RPA" for searching result, and then
00:10:19 add a Click activity in this button. Now next navigate to the Wait multiple flowchart.
00:10:27 If the search result has already been performed previously, and that page is present, then
00:10:33 it should come and read the value in my search result management page.
00:10:39 This will ask me a branch name, I will name it Search and click OK.

00:10:48 If it is my first page, it will first write the RPA in the search input box, click on button,
00:10:56 and then it will come to my search result management page. One thing we always have to
remember is that
00:11:03 wait multiple cannot be our start step. So I will add a Log activity before the Wait multiple.
00:11:12 I will come to the System category. From there, I will drag and drop the Log activity.
00:11:19 Connect with the Start actions and Write log activity, connect with the Wait multiple.
00:11:27 In the Write log, write a message "This is a example of waitMultiple". Okay.
00:11:47 Let's save it and build the code... So code generation completed with zero errors.
00:11:57 And the waitmultiple.js file has been generated. I will double-click on the file and open it.
00:12:04 Let's see how the code has been generated. First, we have the Write_log activity
00:12:10 with the message which I have mentioned there. Next to that, it will check whether the
00:12:18 page has appeared. If it is there, then it will end the step
00:12:23 with that Default. Else, it will check whether the pSearchResult page
00:12:28 is present or not. If this pSearchResult page is in the screen,
00:12:34 it will end the step with the Search tag. Now here the scenario has been generated.
00:12:42 The first step is the write log. If the end step's tag is Default,
00:12:49 then it will go to pHttpsHelpSapCom management one.
00:12:55 If the end step is Search, then it will go to pSearchResult management.
00:13:02 So depending on which page appears in our screen, it will perform the next steps.
00:13:11 This is how wait multiple works. Next I will show you, switch output.
00:13:21 If I come to SAP Help Portal, we will get a small icon in the right-hand corner
00:13:29 which asks for the log on. If I click on that,
00:13:34 it will log me on to SAP Help Portal. And that particular time in the home page,
00:13:45 the log on button will not be present. Instead of that, the username will appear there.
00:13:51 So there is a use case where we need to decide whether we need to click on that SAP log on
00:14:01 or we can directly jump to our search page. To handle this kind of use case,
00:14:07 we can utilize switch output. Now I will come to SAP Intelligent RPA Desktop Studio
00:14:21 and show you how to use the switch output activity. For that, I have defined that login button
00:14:31 in our applications. And if I click on the button,
00:14:37 this particular small log in icon will be highlighted. I will come back to my workflow.
00:14:45 Create a new workflow, SwitchOutput... Click Save.
00:14:59 I will make it a little expanded. So from the flowchart I will select the Switch output activity,
00:15:09 drag and drop it here, and, before that, I will add our home page first.
00:15:20 Connect the home page with the Start activity and navigate to our home page.
00:15:27 And there I will say... If this particular log in button is present,...
00:15:45 then click on it.... This click should be within the If block.
00:15:54 And here, I have to add the condition, so my condition is supposed to be
00:15:59 that log in button item is present. So $item$ and after that select HelpSAP
00:16:10 pHttpsHelpSapCom and btLogon.
00:16:16 If this item dot exist, then click on logon, else, I will add the Else activity
00:16:29 and what it will be the else. It will give me the output in the Miscellaneous category
00:16:37 you will get the option Output. Give an output: Search...
00:16:47 And once the click is done for the If condition, it will also show me the output for
00:16:55 this particular If block. And that output is login...

00:17:04 Now we can utilize these two outputs in our Switch output activity.
00:17:11 I will come back to my Switch output flowchart, and I will connect Switch output with my previous
00:17:22 And say you have to search it in the home page. If it is a login, else you can go to the
SearchResult page.
00:17:35 So here if I connect it, it will ask me a name for this branch. Here I have to make sure whatever
the string
00:17:44 I am going to use for this branch is the same as the string I have used for the else output.
00:17:52 So I will give the name Search here. Click on OK.
00:17:59 I will double check whether the search and here within the page output search is the same or
00:18:09 Yeah, it's the same. And similar for the default one as well.
00:18:14 So if the If condition gets fulfilled, whatever the output string it returns me,
00:18:22 the same output value has to be mentioned here as a branch name.
00:18:25 So I will give Login. Here also I will make sure I am using
00:18:32 the same string in both cases. Here come to the page and check the output.
00:18:41 Now let's build the code. Workflow generation completed with zero errors.
00:18:48 And the switchoutput.js file has been generated. I will double-click and show you what the code
looks like.
00:18:59 First we have pHttpsHelpSapCom. Here it will check whether the item is present or not.
00:19:07 If the item is present, it will click on that and end with the tag Login.
00:19:14 If the item is not present, then it will end the step with Search.
00:19:18 And here is the scenario. If the first step ends with the Login tag,
00:19:26 then it will go to pHttpsHelpSapCom. If the first step ends with the Search tag,
00:19:35 then it will go to HelpSAP.steps.pSearchResult management. So this is the way we can use
switch case.
00:19:46 One to switch page, depending on the page that appears in our screen.
00:19:55 And another is the output sent from our previous steps. These are some of the advanced
00:20:04 to create the workflow. Let's have a short break
00:20:08 and continue in the next video with the second part of this unit.

Week 02 Unit 04

00:00:05 Hello, and welcome back to the second part of advanced workflow design.
00:00:10 Let's jump directly to the demo. Here, first I will guide you through
00:00:21 how to use previously defined steps. So create a new workflow:
00:00:30 ReuseActivity...Example. Click on Save.
00:00:43 Here, in our loop example, we have already defined one step,
00:00:49 which writes the value in the search input box, and click on the search button.
00:00:56 I want to utilize this particular step in my new workflow. To do that, I will come to my
00:01:08 I will drag and drop that particular step in my current workflow.
00:01:15 So here you can see, one activity has been added with reuse with the step name.
00:01:26 If I come to Properties, you can see the step to reuse.
00:01:29 The name of the step has been added. Now I will add this particular step,
00:01:35 with my start activity and we'll build the code... So, workflow generation has completed.
00:02:19 Now the ReuseActivityExample file also been created. Let's open this one.
00:02:26 And here you can see, within the scenario,
00:02:31 it has called my previous step, that is HelpSAP steps and within that pHttpsHelpSapCom
00:02:44 So, instead of creating or repeating the same set of codes, I have just re-utilized whatever I have
00:02:53 in the new example. Now, next I will show how to create out of the scenario code
00:03:02 and why we need out of the scenario. In our workflow,
00:03:07 let's create a new workflow name out of the scenario... Save it.
00:03:20 And here I will drag and drop one page activity. Instead of adding or connecting it with the Start
00:03:33 I will directly go inside the page and set here one value.
00:03:42 Here I will write: "SAP Intelligent RPA".
00:03:53 And I will add a Click activity here... I will not connect this particular page
00:04:06 with the Start activity. and I will build the code...
00:04:35 Workflow generation is completed. I will open the outofscenario.js file and see
00:04:43 here all the steps have been generated. But there is no start or any other scenario.
00:04:50 So, if we don't connect any of the code with previous steps or with the start one,
00:04:58 those activities will come as a global set of code. Here for the out of scenario activity,
00:05:13 we have to remember, we cannot use some advanced mechanisms like loop, switch output, wait
multiple, and so on.
00:05:24 In a single page, there can be any number of simple steps and activities, which can be utilized
00:05:33 as a global set of code. And global set of code will execute first
00:05:39 and later it will go and execute the rest of the connected steps.
00:05:50 So this is all about the advanced way to define the workflow.
00:05:55 But when we are working with the advanced level of workflow, there we have to make sure we
are using
00:06:01 the merge tool activity... There we have to make sure we are using merge tool.
00:06:13 To add the merge tool you have to go to Settings. Come to Workflow, and there you can add
merge zool.
00:06:25 Here I have used a KDiff. Apart from KDiff, you can use Beyond Comparison.
00:06:33 Once you've selected the merge tool .exe file, here, from the dropdown, you can select which
merge command

00:06:42 line you want to use. Here I have selected the KDiff3.
00:06:46 If that merge command line is not enough for you, you can go to that merge tool website
00:06:54 and check what other command line activity is present. For KDiff3 and Beyond Compare,
00:07:02 command line activity is provided by the SAP Intelligent RPA Desktop Studio SDK.
00:07:10 So why do we need the merge tool? Let's see in our next example.
00:07:17 So, to show you when we need the merge tool, I will create a new workflow: MergeExample...
00:07:37 Here, first I will add our first page, SAP Help Portal page.
00:07:44 There I will add a set activity in this particular search input box.
00:07:52 Here I will give the value "SAP Intelligent RPA". And I'll build the code...
00:08:33 So the mergeexample.js file has been generated. I will open that, and here all the start and
00:08:42 have been generated by the workflow generations. If I come to the pHttpsHelpSapCom scenario
00:08:52 here you can see the SAP Intelligent RPA set activity has been added.
00:08:59 Now, in my previous unit, I have said reverse engineering is not performed
00:09:05 by the SAP Intelligent RPA Desktop Studio. So, whatever the code we add in our workflow,
00:09:12 that also gets represented in the editor scripts. But if we manually add any line of code in our
00:09:21 that will not get reflected in the workflow. Here I will add one click activity.
00:09:31 So, HelpSAP object dot pHttpsSapCom dot oSearchButton dot click.
00:09:52 If I come to my workflow now and, within this page, we can see only the Set activity present
00:10:00 not the Click activity. Now I will build the code again...
00:10:33 And we can see both the code is present which has manually been added
00:10:37 and which is from the workflow. And if I come to the workflow, the set of code
00:10:43 which has been added from the workflow only present in the workflow level.
00:10:48 So here the merge tool is smart enough to understand which code it needs to keep and which
00:10:55 Manually, I have added the Click activity that is also present and, from the workflow level,
00:11:01 I have added the set activity. It has also added.
00:11:05 But at some point in time, the merge activity will not be able to understand
00:11:11 whether we have to keep both the code, or we need to select a single line of code.
00:11:17 At that point in time, merge tool will give you the popup. So, let's see when this kind of scenario
can happen.
00:11:24 I will come to MergeExample, pHttpsHelpSapCom page.
00:11:33 From the activity level, I will come to the System category and add a log.
00:11:41 Here I will set a message... And it will write "Log from Workflow".
00:11:57 I will save that. Now again I will come to my editor
00:12:02 and I will open the mergeexample.js file. Here, after Click activity, manually I will add
00:12:11 another Log activity. So here ctx.log.
00:12:18 And here I will write the log: "Log from JS"...
00:12:40 At the same time, I have added two log activities, one from the workflow level,
00:12:46 another from the script level, manually. Now, let's build the code again.
00:12:54 And here the merge tool will give me the popup because it is not sure whether it has to
00:13:00 add code or it has to add only a single Log activity. So here the A is the ancestor code.
00:13:09 Next we have the code which has been generated, and this is the code which has been
manually added.
00:13:17 Now I want to add log from workflow. So here I will click on the B,

00:13:24 and immediately in my generated output code, the log activity has been added.
00:13:30 But this time, I want to keep the manually added log activity as well,
00:13:36 so I will click on C as well. Immediately whatever the code has been added manually,
00:13:42 that has also been added. Now, I will press Control+S and close this popup.
00:13:50 Now it will build the code... Code generation is completed.
00:14:18 And here you can see this is the line which has been added from the workflow.
00:14:24 Next we have the code, which has again been added from the workflow log.
00:14:30 Then we have the Click activity, which I have added manually.
00:14:33 And then we have the log which I have added from the JavaScript file.
00:14:39 So, this is the way we can utilize the merge tool and we need to add the merge tool
00:14:46 in ours settings and workflow. That's it for this unit.
00:14:52 In the next unit, Samir will guide you through how to write custom code in the editor.
00:14:57 Thank you. Goodbye.

Week 02 Unit 05

00:00:08 Welcome back to week two, unit five, Orchestration and Configuration.
00:00:16 Let's see where we are. Once you have defined your project in the Studio
00:00:23 and made some tests, now it is time to explore the project as a desktop package
00:00:30 that will import in the Cloud Factory. The Cloud Factory is in charge of resource management,
00:00:41 deployment, and monitoring. So, let's review the resource management.
00:00:54 Prior to using the whole solution, you need to declare the agent structure.
00:00:59 This is done by importing a CSV file. For a given hierarchy, a node, or even for an agent,
00:01:05 you can allocate time for unattended usage. In case of mixed deployment, this can be useful.
00:01:15 Intelligent RPA takes into account at the early stage the concept of DEV-TEST-PROD.
00:01:21 However, you can define several environments. Maybe you want to separate Finance from
Supply Chain,
00:01:28 a location to another location. Once created, you simply bind to a well-known type,
00:01:35 and link to a hierarchy by using a variable. Let's have a look with a demo.
00:01:43 So I'm connecting here, I can see the different tabs, so the Management here,
00:01:49 there is no Environment, and let's have a look at the Hierarchies,
00:01:53 and there is no hierarchy. So, I'm going to create a new hierarchy.
00:01:58 By simply adding "My Machines" here. I won't input a CSV, just create from scratch.
00:02:09 I'm going to create a new node here, so that will call it "All Machines".
00:02:19 Okay, great. Good. So I'm selecting this node here,
00:02:24 and I'm going to add a new one, "My Machine," fill the name, which is the virtual machine
00:02:31 that I'm going to use here, and I click on Create. Good.
00:02:37 And, what I'm going to do, I will allocate some time for unattended execution,
00:02:41 so I can use the date range here. I start here. And I can define, if needed, an end date.
00:02:51 So, ending with the end of the year, for instance. And then, I can clear if needed,
00:03:00 and then I will allocate from Monday to Friday, all the time, for this hierarchy.
00:03:07 Okay, that's it, going back to the Hierarchies. We switch on Environments,
00:03:12 I'm going to create a new environment from scratch here. I'm going to name it Alex Test
00:03:21 No description for now. I can add it, if needed.
00:03:25 The type is test and I'm selecting the hierarchy that I just selected and the hierarchy node, and
that's it.
00:03:32 This is how you are going to create your first environment, and the first hierarchy that you could
use later.
00:03:40 That's it for the demo... Let's review how to deploy.
00:03:53 At the beginning of your project, you will use the Packages and the Deployment tabs a lot.
00:04:00 From here, you have a view of all packages imported from the Studio.
00:04:06 Once a package is imported and deployed, you can specify triggers.
00:04:13 Once your package is deployed, we can add triggers.
00:04:16 Triggers are the rules that the package will use to perform its purpose.
00:04:22 In attended usage, you can simply define the environment and the date ranges.
00:04:28 In unattended usage, you can specify, in addition, which scenario will be used.
00:04:34 A powerful planner gives you the ability to define some kind of time window
00:04:38 for which a process should be executed or not. For unattended usage,
00:04:43 you can define the schedule from minutes to months. Let's talk about the dashboarding and

00:04:53 If you are looking for all the details related to a job, this is the tab you need to go to.
00:05:00 All information is kept here. Sorting and filtering are doable on various facets.
00:05:06 All agents that have been registered here in the system are displayed here.
00:05:11 You have essential information here like the agent name, login, machine name, or the status.
00:05:19 As mentioned before, jobs are displayed in this tab. You can filter, search, sort, on various
00:05:27 You can cancel a job or even all jobs if needed. Agents are displayed in this tab.
00:05:36 You can again filter, search, or sort, on various dimensions.
00:05:41 If needed, you can unregister an agent. This is the end of this unit, and of week 2.
00:05:51 I hope you got a good first impression of the development phase.
00:05:56 In week 3, we'll give you even more details about it. Thank you.


© 2019 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are
all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation
to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are
cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See www.sap.com/copyright for additional trademark information and notices.