BulePrism进阶教程-12. Advanced Features

本文档介绍了Blue Prism的高级特性,包括未定义集合、数据项初始化、数据项暴露、环境变量和会话变量的使用、类型转换(casting)、Active Accessibility的抓取、应用管理器模式、全局点击和按键、凭证管理、环境锁定以及命令行和资源PC的运行模式。通过实例展示了如何操作和理解这些高级特性。
摘要由CSDN通过智能技术生成

12.1. Undefined Collections
Until recently, the Collections we have used have been defined, meaning that their column names and data types have been set up by us in advance.
When using a Collection to receive an output parameter, it is possible to leave the Collection undefined, i.e., with no columns set up at all. You may have noticed that we have already done this in Exercise 9.1.1.
Exercise 12.1.1 Queue Item Data Collection
 Go back to the Queue Exercises 1 Process and step through to the Get Next Item action. Look at the properties of the Collection used for the output parameter. Is there anything odd about it?
 Tip: Look at the Initial Values tab and then at the Current Values tab.
The Collection is undefined, i.e., it has no columns to begin with. It only receives its definition when the Process runs the Get Next Item action.
Key Point

Collections are the only kind of Data Item that can behave in this way. All other Data Items must be predefined with a data type.
12.2. Data Item Initialization
We have looked at how a Data Item can be given an initial value, and that this default value will also be used as the current value when running starts. By default a Data Item is only visible from its own page, but un-checking the Visibility check box on the properties form will make the Data Item global.

Figure 160: Data Item Properties
Just below the Visibility checkbox is another checkbox named “Initialization”, and it controls how the current value of a Data Item is affected when its page is run.
By default, the current value is reset to the initial value when the start stage of the page is reached. When the checkbox is un-checked, the current value is maintained and not reset. Both settings have their advantages, depending on the circumstances.
For example, global Data Items can be placed on a page that simply links the start stage to an End stage. Although the page will appear to do nothing, it can be used to ensure that the global Data Items are put back to their initial values simply by running the “Reset” page.
Figure 161: Resetting Global Data Items
12.3. Data Item Exposure
Data Items can have their values controlled from outside the diagram - this is done by exposing a Data Item. By default, Data Items are not exposed but we will look at how that can be changed.
Environment Variables
Exercise 12.3.1 Using Environment Variables
An Environment Variable is a value that is made available to all Processes and Business Objects, i.e., across the environment.
In order for the following exercise to work, we will need to import a Business Object that allows the process to use a "Sleep" action. Following the action we carried out in the earlier exercise to import the Excel Object, we will need to install the BPA Object - Utility - General.
To install the Utility - General object, go to Blue Prism and click File – Import and then select the BPA Object - Utility - General.xml file from the VBO directory.
 The Business Object is named Utility – General.
 The object is in C:\Program Files\Blue Prism Limited\Blue Prism Automate\VBO.
 Go to System Manager and look at the Environment Variables tab in the Processes section.
 Add a new Environment Variable named Stopping Time with data type Time and a value of three or four minutes from now.
 Tip: Remember to click the Apply button.
 Create a new Process named Stopping Test.
 Create a Data Item named Stopping Time, and use the Exposure field to link this to the Environment Variable, as illustrated.

Commercial in Confidence Page 136 of 158
Figure 162: Configuring Data Item Exposure
 We also want to use a “Sleep” action if the “Stopping Time” is not reached. This means the process can “Sleep” or “Wait for a time defined”.
 To use a “Sleep” action, from the previously imported Utility – General Object, place an action on the page and select the Utility – General VBO and use the action “Sleep”.
 You will see there is an “input” for “Sleep Time” set this to 10 seconds. When the process is running if the Sleeping Time is not met, the process can “Sleep” for 10 seconds before carrying on and checking.
Figure 163: Setting up the Sleep Action
 Configure your Process to spin in a loop until the stopping time is reached.
 IMPORTANT: Switch off logging within the process to prevent the database filling up.
 Tip: to disable logging use the combo box at the bottom of the “Stop?” and “Sleep” properties dialog boxes or via the edit menu Edit > All Stages.
 Your process should look something like this:

 Save and publish your Process.
 Amend the System Manager Environment Variable to be one or two minutes into the future, if necessary.
 Run the Process and check it stops at the appointed time.
Exercise 12.3.2 Environment Variable Use Cases
Consider why you might want to centralize the control of such variables into System Manager. Consider also the advantages of several Processes being able to reference the same Environment Variables.
 Create a Calculation stage and attempt to change the value of your environment variable.
 Press the Validate button and observe the error message.
Key Points
 Environment Variables are available to all Processes and Business Objects.
 Data Items exposed as Environment Variables are read-only.
 The name and type of the Data Item must match the Environment

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值