查看 Automation 360 Package SDK v.29 版本中的新增内容。

新增内容

SDK 下载链接: A360-package-sdk-2.8.0.zip
return_Direct attribute

在操作级别添加了一个新属性 return_Direct = true。 输出中将只显示一个选择 Record 类型变量的选项。

例如:

@BotCommand
@CommandPkg(
        return_label = "[[AddColumn.return_label]]",        
        node_label = "[[AddColumn.node_label]]",
        label = "[[AddColumn.label]]",        
        description = "[[AddColumn.description]]",        
        name = "addColumn",        
        icon = "record.svg",        
        return_type = DataType.RECORD,        
        return_Direct = true,        
        return_required = true,        
        minimum_controlroom_version = "17917",        
        minimum_botagent_version = "21.134",        
        documentation_url = RECORD_ADD_COLUMN_URL,        
        documentation_widget_page = RECORD_ADD_COLUMN_WIDGET)
OAUTHCONNECTION 属性

添加了新的属性类型 OAUTHCONNECTION,用于从 Control Room 的预配置 OAuth Connection 值中获取访问令牌。

例如:

@Idx(index = "1", type = AttributeType.OAUTHCONNECTION)
@Pkg(label = "[[OAuthConnectionTypeDemo.connection.label]]")
OAuthConnection connection
新规则 VariableMapAllowedDataTypes 添加到 VARIABLEMAP

VariableMapAllowedDataTypes 允许您根据特定变量类型筛选 UI。 VariableMap 是一个控件,可为任何操作添加变量选择(在机器人编辑器 UI 中)。 使用 VariableMapAllowedDataTypes 筛选器,您可以限制在操作中使用的变量的数据类型。 例如,如果将 VariableMapAllowedDataTypes 设置为 String,则将在操作中仅列出字符串变量。


@Idx(index = "4", type = VARIABLEMAP)
        @Pkg(label = "[[LogVariables.selectVariable.label]]")
        @NotEmpty
        @VariableType(DataType.VARIABLEMAP)
        @VariableMapAllowedDataTypes({
            DataType.STRING,
            DataType.NUMBER,
            DataType.BOOLEAN,
            DataType.DATETIME
        })
        Map<String, Value> variables
@DesktopOperationContext 注释

新注释 @DesktopOperationContext 用于在 DesktopOperation 中注入 DesktopOperationContext,类似于 GlobalSessionContext

此注释应用于带有 setter 方法的属性,以便生成的文件可以将 DesktopOperationContext 设置为目标文件。

通过注入 DesktopOperationContext,可以从 GlobalSessionContext 访问 DesktopOperation 中的以下属性:

  1. getUserToken
  2. getCrUrl
  3. resolveResource
  4. getExternalEnvironment
  5. getProxyConfig
  6. botId
  7. getResources

@BotCommand(commandType = BotCommand.CommandType.DESKTOP_OPERATION_BUTTON)
@CommandPkg(name = "RESTRecorder", desktop_operation_name = "RESTRecorder")
public class RecorderOperation {

    private static final Logger LOGGER = LogManager.getLogger(RecorderOperation.class);

    @Request private DesktopOperationButtonRequest request;

    @DesktopOperationContext    private com.automationanywhere.toolchain.runtime.operation.context.DesktopOperationContext context;

    public void setRequest(DesktopOperationButtonRequest request) {
        this.request = request;
    }

    public void setContext(
            com.automationanywhere.toolchain.runtime.operation.context.DesktopOperationContext                    context) {
        this.context = context;
    }