Legacy Automation package

actions Legacy Automation 中的 package 仅用于迁移的 bots 中,以确保它们在 Automation 360 中无缝运行。 我们推荐使用此软件包进行新 bot 开发。

重要: 仅在从 Enterprise 10/Enterprise 11 迁移到 Automation 360bots 中使用 Legacy Automation package 表达式。在 Automation 360 中创建的新自动化不支持 Legacy Automation package 及其对应的表达式。
注: 如果您使用 botactions 或更早版本的 Legacy Automation package 构建 Build 5322,则在使用默认 actions 版本打开 bot 时,package 将会丢失。 您必须重新插入 actions 并重新填充字段。

表达式

表达式显示在 action 输入字段中。 此 package 包含以下表达式:

表达式 描述 使用示例
DictionaryToString 将字典变量转换为字符串变量 {{$dictionaryVar.LegacyAutomation:dictionaryToString$}}

输出为具有以下值的字符串变量:{key1,value1},{key2,value2}

GetAbsolutePath 为您提供系统上所有(非Automation Anywhere)文件的相对路径,路径开头有一个全局变量。 在 Enterprise 11Enterprise 10 中,GetAbsolutePath 的等同项位于 工具 > 选项 > 运行时设置 > 任务起始路径。

Enterprise 11Enterprise 10 中,存储库中的任何文件夹都可以用作 GetAbsolutePath 值的起始路径。 如果 Enterprise 11Enterprise 10 bot 中的路径是绝对路径,则迁移流程不会对已完成迁移的 bot 做任何更改。 如果 Enterprise 11Enterprise 10 bot 中的路径是相对路径并包含变量,则迁移流程会在路径开头添加全局变量作为前缀,与相对值路径一起使用。

  • variable.txt: 本示例中提供的输入是相对路径,输出将是 C:\testing\variable.txt,其中 C:\testing\variable.txt 是起始路径。
  • \\\\datashare\\variable.txt: 本示例中提供的输入是一个网络路径,输出将是 \\datashare\variable.txt
  • D:\testing\Automation Anywhere Files\Automation Anywhere\My Docs\mydoc.docx: 本示例中提供的输入是一个绝对路径,输出将是 D:\testing\Automation Anywhere Files\Automation Anywhere\My Docs\mydoc.docx
GetBotPath 修改 botEnterprise 11 Enterprise 10bots 路径变量的值,并根据 bot 存储库将其替换为相对 Automation 360 路径。 bot 路径的值基于本地路径或网络路径的 ApplicationPath
  • D:\testing\Automation Anywhere Files\Automation Anywhere\Bots\My Tasks\test.atmx: 本示例中提供的输入是一个绝对路径,在该工单中,输出路径将是 My Tasks/test
  • $AAApplicationPath$\Automation Anywhere Files \Automation Anywhere\Bots\My Tasks\test.atmx: 此输入中提供的示例与 $AAApplicationPath$ 相关,输出将是 My Tasks/test
  • \\Automation Anywhere Files\Automation Anywhere\Bots\My Tasks\test.atmx: 此输入中提供的示例是一个网络路径,输出将是 My Tasks/test
GetDecrementedNumber 将相应变量的值减少 1。 它主要用于列表、录制、数组或表变量的索引位置。 $myArray[$Loop-Counter-1.LegacyAutomation:getDecrementedNumber$][0]$

myNumber 的输出随着循环的每次迭代而减少 1。

GetIncrementedNumber 将相应变量的值增加 1。 它主要用于列表、录制、数组或表变量的索引位置。 $Loop-Counter-1.LegacyAutomation:getIncrementedNumber.Number:toString$ myNumber 的输出随着循环的每次迭代而增加 1。
GetKeystrokeCount 计算短语/文本中的击键值
注: 特殊字符,如 [TAB]、[END] 或 [PAGE DOWN],被计为一个击键。
$KeyStroke-CharLength.LegacyAutomation:getKeystrokeCount.String:toNumber$

输出为每个击键的平均延迟。

GetLegacyIndexValue botsEnterprise 11 中迁移的 Enterprise 10 列表变量的特定索引位置检索值。 如果索引位置大于列表变量的大小,系统会从迁移的 bots 列表中的第一个索引位置检索值。
ListToString 将列表变量转换为字符串变量。 {{$listVar.LegacyAutomation:listToString$}}

输出为具有以下值的字符串变量:value1、value2、value3

ListToTable 将列表变量转换为表变量。 {{$my-list-variable.LegacyAutomation:listToTable$}}

输出为一个表变量,其中每个列表值都是单列中的单元格。

ParseLegacyKeys 确保存储在变量中的 Enterprise 10/Enterprise 11 botsInsert Key Stroke 命令在执行时成功。 此表达式在执行过程中将其转换为等效 Automation 360 的击键。
注: 某些特殊字符的外观在 Version 11.3Automation 360 之间有所不同。 例如,Page Up 键在 Version 11.3 中显示为 [PAGE UP],在 Automation 360 中显示为 [PAGE-UP]。 此差异不会影响 bot 函数。
$Test.LegacyAutomation:parseLegacyKeys$
ParseVariableOperation 解析 Enterprise 10/Enterprise 11 Variable Operation 命令中提供的表达式。 此表达式可确保在执行 Automation 360 时返回与 Enterprise 10/Enterprise 11 bots 相同的输出。 $prompt-assignment.LegacyAutomation:parseVariableOperation$
TableToString 将表变量转换为字符串变量。

您还可以使用分隔符(例如冒号、分号或空格)分隔输出中的字符串变量值。

{{$tableVar.LegacyAutomation:tableToString$}}

输出为具有以下值的字符串变量:{value1,value2},{value3,value4}

使用冒号、分号或空格作为 <"delimiter">:

{{$tableVar.LegacyAutomation:tableToString(<"delimiter">)$}} 例如:
{{$tableVar.LegacyAutomation:tableToString(":")$}}

输出为具有以下值的字符串变量:{value1:value2}:{value3:value4}

TableToList 将表变量转换为列表变量。 {{$DataTable.LegacyAutomation:tableToList(<column_index>)$}} 例如:{{$DataTable.LegacyAutomation:tableToList(2)$}}

输出为具有以下值的列表变量:[value1,value2,value3]

StringToList 将字符串类型变量转换为列表类型变量 $SampleString.LegacyAutomation:stringToList$

输出是一个大小为 1 的列表变量,其值与“SampleString”相同。

StringToTable 将字符串类型变量转换为数据表类型变量 $SampleString.LegacyAutomation:stringToTable$

输出是一个数据表变量,大小为 (1*1),索引 [0,0] 处的值与 SampleString 相同。