As we have seen, Business Objects encapsulate the functionality of applications. A Business Object is only intended to be used via a Process and cannot be exposed to Control Room.
6.1. Creating a Business Object
We have briefly looked at Object Studio and seen that it is like Process Studio but with some additional features. In this section, we will look at how Object Studio is used to configure Business Objects.
Exercise 6.1.1 New Business Object
In this exercise, we will create a Business Object that can launch and log into the Order System training application.
Navigate to Studio and create a new Business Object named Order System. You could use any name but it makes sense to go with the name of the application.
Once you are into Object Studio, you will have three pages - Initialize, Clean Up, and Action 1.
Tip: Initialize and Clean Up are default pages present in every Business Object and we will look at their purpose later on.
Figure 56: New Business Object Wizard
6.2. Application Modeler
We know that the purpose of a Business Object is to integrate with an application so as to provide a Process with the means to use the application. In order to create this integration, we must first “teach” the Business Object about the application by creating an Application Model.
Exercise 6.2.1 Application Modeler Wizard
Object Studio has a feature named Application Modeler that enables us to create a logical representation of an application. In this exercise, we will see how to set up Application Modeler with the basic details of the target application, Order System.
Figure 57: Application Modeler Toolbar Button
Open Application Modeler by pressing the toolbar button. The first time you open Application Modeler, a dialog box will appear asking for initial setup details.
Follow the steps through using these details:
Select Define a new Application Model with the name Order System.
Windows application type.
Application will be launched from an executable file C:\BluePrism\Training\Applications\Windows\TrainingOrderSystem.exe.
Step through the remaining steps in the Wizard by accepting the default values.
Tip: We will look at advanced topics like command line parameters and invasive techniques later.
Once the steps are complete, you will be presented with the Application Modeler screen.
Figure 58: Application Modeler
The purpose of Application Modeler is to capture details of elements of the application user interface, things like fields, buttons, and windows. Once we have defined the elements we want to use, we can set about creating a diagram to interact with them
Exercise 6.2.2 Identify Elements
In order to select the application elements we want to use, we first have to launch the application. In this exercise, we will launch Order System and look at how Application Modeler finds elements on the application screen.
“OK” the Application Modeler to return to Object Studio.
Resize the Object Studio to about two-thirds the size of the desktop. Although not essential, having Object Studio slightly smaller than the desktop will help when we have multiple windows open.
Open Application Modeler again. Notice that this time the “initial setup” wizard does not appear.
Press the Launch button and wait for the Order System Sign In window to appear.
Figure 59: Order System
Select “Element1” in the element tree on the left then press the Identify button (NB: the same button is used for “Launch” and “Identify”, and changes name once the application is launched).
Move the mouse over the Order System window. See that the individual elements of the window are being highlighted in red. Application Modeler is investigating the structure of the Order System window as the mouse moves over it. This is known as spying or spy mode.
Figure 60: Spying Order System
Before learning to identify elements, we will first cancel this spying operation. Hold down the CTRL key and right-click anywhere on the Order System application to cancel the highlighting and return to Application Modeler.
6.3. Spying Elements
Application Modeler spies elements as the mouse is moved over the application window. Details of an element can be captured by holding the CTRL key and clicking the left mouse button.
Exercise 6.3.1 Spying Elements
In this exercise, we will spy part of Order System and look at the details Application Manager captures.
Press the Identify Element button again and spy the Order System window. Move the mouse towards the top of the window so that the red highlighting surrounds the whole window.
Figure 61: Spying the Order System Window
Hold down “CTRL” and left-click on an open area of the window. See that Application Modeler is now populated with details of the window.
Figure 62: Window Element Details
Key Points
Keep “CTRL” down until you’ve clicked the mouse.
To exit spy mode, it’s CTRL+right-click.
6.4. Attributes
Application details are drawn from the application as a list of attributes. These attributes are not data created by Blue Prism; attributes are characteristics of the element provided to Blue Prism by the application.
6.4. Attributes
Application details are drawn from the application as a list of attributes. These attributes are not data created by Blue Prism; attributes are characteristics of the element provided to Blue Prism by the application.
Once captured, this information can enable a Business Object to “remember” an element, and it does this by using a selection of attributes as the “fingerprint” of an element. This fingerprint is then used to identify and interact with the element from the Object Studio diagram.
Exercise 6.4.1 The Attribute List
Take a moment to scroll down the list of attributes.
Although some attributes may seem mysterious, you may recognize others, like “Window Text”.
Key Points
Attributes do not come from Blue Prism; the application provides these data to Application Modeler.
Application Modeler forms these attributes into elements.
Object Studio uses the elements to manipulate the application.
6.5. Attribute Selection
Application Modeler retrieves all available attributes from the application but typically only some of these are used to form the element fingerprint. The selected attributes are shown in the Match column, and can be checked or un-checked as required. The initial selection is a default choice made when the element is first spied, and although this first choice is often correct, it may well require manual adjustment to make a unique fingerprint.
There are many types of element (buttons, text boxes, etc.) used by many different kinds of applications (thick-client, thin-client, mainframe, etc.), each with a different set of attributes. Blue Prism cannot anticipate the construction of every kind of application it will ever encounter, and as such it is important to realize the initial selection of attributes made by Application Modeler is a suggestion and not an instruction.
Application Modeler cannot know for certain which combination of attributes will form a unique element fingerprint, but can posit a suggestion based on the type of element and type of application. The responsibility for finding the unique combination ultimately rests with you, the creator of the Business Object.
Key Points
Application Modeler suggests a selection of attributes when the element is spied.
The selection must uniquely identify the element and may require manual alteration.
In order to test whether Application Modeler has “remembered” the element correctly and that the element fingerprint is unique, we can ask it to try and “find” the element again.
Exercise 6.5.1 Highlighting Elements
In this exercise, we’ll check if the current selection of attributes enables Application Modeler with to “find” the element properly.
Press Highlight Element to instruct Application Modeler to find the element.
Notice how the Order System window is highlighted in red. This means Application Modeler can “see” the element and that the attribute selection is acceptable.
Highlight the element again - you can do this as often as you like.
Rename the element from “Element 1” to “Log In Window” and press “OK” to close Application Modeler (NB: you do not have to press “Apply” before “OK”).
We now have the beginnings of our model of Order System. Granted, the model only contains one element but it is enough for us to make a start in Object Studio. We will return to Application Modeler when we need more elements.
Key Point
The application model should not be created in one go but built up gradually. After spying a few elements, return to Object Studio to check their use from the diagram.
6.6. Launch
We have told Application Modeler how to start the application by giving it the path to the executable (.exe) file, and we have defined the details of the Log In window in our model so that we can use it in Object Studio. We now have enough information about Order System to create a page to launch it.
Exercise 6.6.1 Adding a New Page
In this exercise, we’ll make a page in the Order System Business Object that can launch the application.
Right-click on the Action 1 tab and rename it to Launch.
Notice how the menu is similar the one in Process Studio - new pages are added in a similar way.
Figure 63: Object Studio Page Menu
Best Practice
Figure 64: Page Information Stage
The application model should not be created in one go but built up gradually. After spying a few elements, return to Ob