Action Center
最新
False
横幅背景图像
Action Center
上次更新日期 2024年4月26日

预览
创建操作定义

要将操作输入字段绑定到 Apps 字段,您需要操作定义。

1. 准备操作定义

在将操作定义添加到 Action Center 之前,必须为其创建 JSON 架构。 该文件应遵循 JSON 架构标准。 您还可以下载示例架构,编辑和上传其修改版本。

  1. 首先添加左大括号以指明 JSON 对象的开头。
  2. 在 JSON 对象中,将Name Description属性及其值定义为字符串。
    {
        "Name": "Sample Definition",
        "Description": "Sample Definition Description"{
        "Name": "Sample Definition",
        "Description": "Sample Definition Description"
    
  3. 添加Allowed Actions属性作为字符串数组,以指定您可以在操作末尾执行的允许操作。 这些值应等于 “批准”或 “拒绝”。
    "AllowedActions": [
            "Start On-boarding",
            "Request more details"
        ],"AllowedActions": [
            "Start On-boarding",
            "Request more details"
        ],
    
  4. 添加Schema属性,并为其分配一个符合 JSON 架构标准的对象: http://json-schema.org/draft-07/schema#
    "Schema": {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "type": "object","Schema": {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "type": "object",
    
  5. 在“ properties ”对象中,定义要包含在架构中的每个属性。 为每个属性指定其typedescription
    Schema中的每个属性都等效于您将在“应用程序”操作中添加的输入字段。
    "properties": {
                "employee_id": {
                    "type": "string",
                    "description": "The unique identifier of the employee."
                },
                "first_name": {
                    "type": "string",
                    "description": "The first name of the employee."
                },
                "last_name": {
                    "type": "string",
                    "description": "The last name of the employee."
                },
                "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The email address of the employee."
                },
                "address": {
                    "type": "object",
                    "properties": {
                        "street": {
                            "type": "string",
                            "description": "The street address of the employee."
                        },
                        "city": {
                            "type": "string",
                            "description": "The city where the employee resides."
                        },
                        "state": {
                            "type": "string",
                            "description": "The state where the employee resides."
                        },
                        "zip_code": {
                            "type": "string",
                            "description": "The zip code of the employee's address."
                        },
                        "country": {
                            "type": "string",
                            "description": "The country where the employee resides."
                        }
                    },
                    "required": [
                        "street",
                        "city",
                        "state",
                        "zip_code",
                        "country"
                    ],
                    "description": "The address of the employee."
                },
                "hire_date": {
                    "type": "string",
                    "format": "date",
                    "description": "The date the employee was hired in the format YYYY-MM-DD."
                },
                "salary": {
                    "type": "number",
                    "minimum": 0,
                    "description": "The salary of the employee."
                }
            }"properties": {
                "employee_id": {
                    "type": "string",
                    "description": "The unique identifier of the employee."
                },
                "first_name": {
                    "type": "string",
                    "description": "The first name of the employee."
                },
                "last_name": {
                    "type": "string",
                    "description": "The last name of the employee."
                },
                "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The email address of the employee."
                },
                "address": {
                    "type": "object",
                    "properties": {
                        "street": {
                            "type": "string",
                            "description": "The street address of the employee."
                        },
                        "city": {
                            "type": "string",
                            "description": "The city where the employee resides."
                        },
                        "state": {
                            "type": "string",
                            "description": "The state where the employee resides."
                        },
                        "zip_code": {
                            "type": "string",
                            "description": "The zip code of the employee's address."
                        },
                        "country": {
                            "type": "string",
                            "description": "The country where the employee resides."
                        }
                    },
                    "required": [
                        "street",
                        "city",
                        "state",
                        "zip_code",
                        "country"
                    ],
                    "description": "The address of the employee."
                },
                "hire_date": {
                    "type": "string",
                    "format": "date",
                    "description": "The date the employee was hired in the format YYYY-MM-DD."
                },
                "salary": {
                    "type": "number",
                    "minimum": 0,
                    "description": "The salary of the employee."
                }
            }
    
    如果您有嵌套对象,例如address ,请根据此示例在properties对象中以类似方式定义它们,并指定它们的类型和属性。
  6. 如果某些属性是必需的,请包括一个required数组,您可以在其中列出要在操作中标记为必需的属性。
    "required": [
                "employee_id",
                "first_name",
                "last_name",
                "email",
                "address",
                "salary",
                "hire_date"
            ]"required": [
                "employee_id",
                "first_name",
                "last_name",
                "email",
                "address",
                "salary",
                "hire_date"
            ]
    
  7. 通过添加右大括号将 JSON 对象括起。

2. 将操作定义上传到 Action Center

创建操作定义的 JSON 架构后,可以将其上传到 Action Center。

  1. 打开 Action Center,导航到“管理员设置” ,然后选择 “租户”。
  2. 在 “操作定义”选项卡中,选择“添加操作定义”
  3. 选择“下载操作定义示例”以下载示例 JSON 架构,以帮助您准备操作定义。
  4. 选择“从文件导入” ,然后选择您之前准备的 JSON 文件。
  5. 输入操作定义的适当名称和说明,然后选择“创建” 。

结果:现在,您可以在 App Studio 中将操作定义作为控件添加到操作应用程序中。

  • 1. 准备操作定义
  • 2. 将操作定义上传到 Action Center

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.