BulePrism进阶教程-2. Process Studio

A Blue Prism Process is created as a diagram that looks much like a common business flow diagram.
Processes are created in an area of Blue Prism named Process Studio which, as we will see, looks similar to other process modeling applications (such MS Visio) and uses standard flow diagram symbols and notation.
The key difference with a Blue Prism diagram is that it is not an inert two-dimensional representation of a Process. Rather, it is the graphical representation of a working computer program, one that will interact with applications, manipulate data, and perform decisions and calculations.
2.1. Running a Process
A Blue Prism Process is not a picture but a program in graphical form. We can run it in Process Studio and watch it working. One of the Process Studio toolbars provides commands to run the Process, similar to the buttons found on a DVD player.

BulePrism进阶教程-2. Process Studio

Figure 1: Go and Reset Toolbar Buttons

Exercise 2.1.1 Opening and Running a Process
 Log into Blue Prism.
 Select the menu File>Open in the main window.
 Follow the wizard to open the Process named Example Process.
 Once you are in Process Studio, find the Go button,BulePrism进阶教程-2. Process Studio , and press it to run the Process.
 See how the flow of the diagram is highlighted in orange.
 Press “Reset”( ) and then press “Go” again.
 Close Process Studio.

Key Point

The Reset ( ) button must always be pressed before re-running a Process.

2.2. Basic Skills
Process diagrams are comprised of various stages connected together using links to form logical structures.
Stages are selected from the toolbar and placed on the diagram using the mouse. They can be selected, moved, resized, formatted, cut, copied, pasted, and deleted, much as you might expect. Stages also have various properties that can be accessed by double clicking.
Links are created using the link tool by dragging the mouse from the center of one stage to the center of another. Dragging without the link tool can be used to select more than one stage at a time.
Exercise 2.2.1 Creating a New Process
 From the main Blue Prism window, select “Studio” from tabbed menu at the top of the screen.

BulePrism进阶教程-2. Process Studio

Or select the Studio icon from the left-hand navigation menu

BulePrism进阶教程-2. Process Studio

Right click the Processes heading under studio and then select “Create a Process” from the context menu.

BulePrism进阶教程-2. Process Studio

Name the new Process “First Process”.
 Enter a brief description of the Process.
 Tip: It’s good practice to add a brief description of what the Process is – to assist when reviewing, maintaining, or enhancing a Process.

The new process will appear beneath the Processes heading. Now double-click it to open it.
 Along the left-hand side of the screen is the Stages toolbar. To put a stage on the page click and drag it into position. Try this by dragging a few different stages onto the page.
 You will notice that one of the stages in the stages toolbar has a blue rectangle highlighting it. Whichever stage is highlighted will be the one added if you click directly on the page. Click on the calculation stage on the toolbar to highlight it.

BulePrism进阶教程-2. Process Studio

Notice how the cursor changes and has the calculation stage icon next to it. Now click on the process page to add a calculation stage. This saves you having to return to the toolbar if you have several stages of the same type to add.
 Even with the calculation stage cursor you can still drag and place other stage types.
 When stages are on the page you can double click on various stages to view their properties.
 Press the Save button but keep the diagram open.

Space in Process Studio is effectively infinite, and pan and zoom tools can be used to maneuver around the diagram. The grid lines and “snap” settings are on by default but these can be switched off (via the View menu) if necessary.
Key Points

 Stages are added by clicking onto the page for the current cursor or by dragging from the toolbar.
 Links are created by dragging from “centre to centre”, not from “edge to edge”.
 Most stages have a single outbound link but some can have more.
 Most stages accept multiple inbound links but some (like the Start stage) cannot be linked to at all.
 Most stages appear on the diagram by a single shape but some have two parts.

Exercise 2.2.2 Saving a Process
Like any computer document, it is prudent to save a Blue Prism diagram every so often while you work on it. Keeping with the same diagram, in this exercise we’ll make a modification and then save the changes.
 Drag and select ALL stages.
 Delete them by pressing the Delete key or by using the mouse menu (i.e. right-click).
 Tip: You may need to zoom out to select everything.
 Notice that two stages have not been deleted - this is intentional. The “Start” and “Information” stages are permanent and cannot be deleted.
 Add a new End stage.
 Link the Start stage to the End stage.
 Press “Save”. By default, each time a process is saved Blue Prism asks for a summary of the changes made.

BulePrism进阶教程-2. Process Studio

Figure 4: Save Process Window
 Tip: It’s good practice to add a brief description when you save a Process. Blue Prism uses your summary when it stores a history of Process changes.

Running the Process
 Press “Go”, ,to run the Process. See how the flow of the diagram is highlighted in orange.
 Press “Reset” and “Go” again.

2.3. Process Validation
Basic configuration errors can be identified by clicking the Validation button on the toolbar. This will run a scan of the current configuration and a list of basic errors and warnings will be displayed.

BulePrism进阶教程-2. Process Studio

Figure 5: Process Validation Button
This functionality can be very useful for checking for basic “schoolboy” errors like typing mistakes or missing links, though it should not be relied on too heavily. If no errors are displayed then it should not be assumed that your Process is error free – the validation does not analyze the logic of a diagram and the onus is on the user to avoid problems like falling into an infinite loop.
Best Practice
2.4. Decision Stage
A Process will rarely follow a single path along a straight line and we are likely to want to give our Process the option to make decisions and to travel one way or another.

BulePrism进阶教程-2. Process Studio

Figure 6: The Decision Stage has two Outbound Links
The Decision stage has two outbound links. If the result of a Decision is true, it takes one direction. If the result is false, it takes the other.

BulePrism进阶教程-2. Process Studio

Figure 7: Decision Stage
The Decision stage is the simplest method to create multiple paths in a Process. The Decision stage works by evaluating the result of an expression as either true or false. Expressions are formulas used to calculate a value of some kind and are used in many other types of stages.

BulePrism进阶教程-2. Process Studio

Figure 8: Decision Properties
Exercise 2.4.1 Adding a Decision Stage
Add a Decision stage to your First Process diagram by following these steps:
 Add a Decision stage and open its properties window with a double click.
 Type the expression 1>2 into the main Expression text area and press “OK”.
 Add a second End stage to the Process.
 Link the Start stage to the Decision stage.
 Link the Decision stage to both End stages.
Notice how one link is marked “Yes” and the other “No”. The resulting Process should look similar to the diagram below:

BulePrism进阶教程-2. Process Studio

 Press “Reset” and “Go” to run the Process. Note which route the Process follows and which End stage it finishes at.
 Enter the Decision stage properties and change the expression to 1<2.
 Press “Reset” and “Go” again. Notice how the Process changes direction according to the expression.
 Right-click on the Decision stage and choose “Switch” from the mouse menu.
 Re-open the Decision stage properties to see that the expression has not changed (still True) - only the links that have been swapped over.
Key Point
2.5. Calculation Stage
Similar to a Decision stage, a Calculation stage uses an expression in its properties window but with one key difference: A Calculation stage needs to retain the result from its expression, whereas a Decision stage only uses its result (True or False) to choose one path or another. A Calculation stage aims to calculate a value and store it somewhere.

BulePrism进阶教程-2. Process Studio

Figure 9: Calculation Toolbar Button

BulePrism进阶教程-2. Process Studio

Figure 10: Calculation Stage

The Calculation stage contains a “Store Result In” field in the middle of the properties window, as shown below:

BulePrism进阶教程-2. Process Studio

Figure 11: Calculation Properties
Results from a Calculation stage are stored in stages known as “Data Items” (see below). The related Data Item for a Calculation stage is noted in the “Store Results In” field in the Calculation stage properties.
2.6. Data Items
These parallelogram-shaped stages act as place holders for values such as numbers, text, and dates. They can be given meaningful names like “Account Number” and employed around the diagram. A programming comparison can be made by likening a Data Item to a variable.

BulePrism进阶教程-2. Process Studio

Figure 12: Data Item Toolbar Button

BulePrism进阶教程-2. Process Studio

Figure 13: Data Item Stage

BulePrism进阶教程-2. Process Studio

Figure 14: Data Item Properties
Key Point

Data Items are not linked into the logical flow, they “float” and cannot be physically connected to any other part of the diagram.
Exercise 2.6.1 Calculations
Continue working on your First Process diagram by following these steps:
 Delete the Decision stage and one of the End stages. (Links are automatically deleted when you delete a stage.)

 Add a Data Item named Z, with a data type of number and an initial value of 9.
 Add a Calculation stage, name it Set Z and open its properties.
 Find Z in the right-hand tree view list of Data Items. These are grouped by data type, so Z will be in the Numbers group.
 Drag Z into the Store Result In field in the Calculation stage properties window.
 Tip: You can also type the Data Item name into the “Store Result In” field. If a typed in Data Item name does NOT match an existing Data Item, a new Data Item will be created with the typed in name.
 Enter the number 7 into the expression text area.
The Calculation stage is now set up to store the result of its expression (i.e., 7) in Data Item Z, and should look something like this:

BulePrism进阶教程-2. Process Studio

Exercise 2.6.2 Calculation to Set Z
 “OK” the Calculation properties and link from the Start to the Calculation stage.
 Link the Calculation stage to the End stage.
 Press “Reset”
 The Process should look similar to the diagram below:

BulePrism进阶教程-2. Process Studio

 Press “Go”.
 Notice the value of Z change from 9 to 7.
 Open the properties of Z to see that the Initial Value and Current Value fields are different.
Exercise 2.6.3 Data Items in Expressions
A Data Item can be included in an expression by enclosing its name in square brackets. This is similar in concept to MS Excel expressions that use cell references, e.g., A3*1.175. Continue working on your diagram:
 Add two new number Data Items named X and Y with initial values of 3 and 7.

BulePrism进阶教程-2. Process Studio

 Edit the Calculation stage properties and change the expression to [X]+[Y].
 Press “Reset” and “Go”.
 Open the properties of Z to see that Current Value is now 10.
 Tip: It can help to think of “Store Result In” as meaning “Z becomes 10” rather than “Z equals 10”.
Key Point

Square brackets must be used to include a Data Item in an expression, e.g., [Account ID].

Exercise 2.6.4 Expressions Using the “Store Result In” Data Item
The Data Item used in the “Store Result In” field can also play a part in the expression. Continue working on your diagram as follows:
 Change the Calculation expression to ([X]*[Y])+[Z]
 Press “Reset” and “Go”
 Open the properties of Z to see that Current Value is now 30
 Tip: The standard logic for using brackets applies to Blue Prism expressions.
2.7. Review
 Creating a Process is like building a flow diagram
 Toolbars are used to place, move, resize, copy, delete, and link stages
 The Go button starts the Process
 The Reset button readies the Process to run again – resetting Data Items to initial values
 Flow direction is changed using a Decision stage to work out an expression that is true or false
 Data Items are used as place holders for values
 Calculation stages use expressions to calculate new values for Data Items
 Data Items can have an initial value and a current value
Blue Prism Keywords
Stage, Start, End, Link, Decision, Expression, Calculation, Store In, Drag and Drop, Data Item, Data Type, Initial Value, Current Value, Go, Reset.