工作流 - 动作
自动化动作扩展模块,允许在自动化工作流中添加自定义动作:




配置
配置结构:
支持两种策略模式:fixed(固定模式)、user‑defined(用户自定义模式);输入参数策略与动态数据策略可独立选择模式,支持混合搭配(例如:入参为 fixed,输出动态属性为 user‑defined)
- 固定模式:
yaml
extensions []
├─ key (string) [Mandatory]
├─ target (string) [Mandatory]
├─ resolver {} [Mandatory]
├─ title (string | i18n) [Mandatory]
├─ icon (string) [Optional]
├─ description (string | i18n) [Optional]
├─ resource (string) [Mandatory]
├─ inputPolicy {} [Mandatory]
│ ├─ mode (string) [Mandatory]
│ └─ allowedTypes [] [Mandatory]
├─ inputSchema [] [Mandatory]
│ ├─ key (string) [Mandatory]
│ ├─ title (string | i18n) [Mandatory]
│ ├─ type (string) [Mandatory]
│ └─ required (boolean) [Mandatory]
├─ dynamicPropertyPolicy {} [Mandatory]
│ ├─ mode (string) [Mandatory]
│ └─ allowedTypes [] [Mandatory]
└─ dynamicPropertySchema [] [Mandatory]
├─ key (string) [Mandatory]
├─ title (string | i18n) [Mandatory]
├─ type (string) [Mandatory]
└─ required (boolean) [Mandatory]- 用户自定义模式:
yaml
extensions []
├─ key (string) [Mandatory]
├─ target (string) [Mandatory]
├─ resolver {} [Mandatory]
├─ title (string | i18n) [Mandatory]
├─ icon (string) [Optional]
├─ description (string | i18n) [Optional]
├─ resource (string) [Mandatory]
├─ inputPolicy {} [Mandatory]
│ ├─ mode (string) [Mandatory]
│ ├─ allowedTypes (string) [Mandatory]
│ └─ maxFields (number) [Mandatory]
└─ dynamicPropertyPolicy {} [Mandatory]
├─ mode (string) [Mandatory]
├─ allowedTypes (string) [Mandatory]
└─ maxFields (number) [Mandatory]配置示例:
- 固定模式:
yaml
extensions:
- key: example-flow-workflow-action
target: "pcm:flow:workflow:action"
resolver:
function: resolver
title: Action title
icon: "resource:example-resource/icons/icon.svg"
description: A sample action
resource: main
inputPolicy:
mode: fixed
allowedTypes: [text]
inputSchema:
- key: inputSchema-key-1
title: InputSchema title
type: text
required: true
dynamicPropertyPolicy:
mode: fixed
allowedTypes: [text]
dynamicPropertySchema:
- key: property-key-1
title: Property title
type: text
required: false- 用户自定义模式:
yaml
extensions:
- key: example-flow-workflow-action
target: "pcm:flow:workflow:action"
resolver:
function: resolver
title: Action title
icon: "resource:main/icons/icon.svg"
description: A sample action
resource: main
inputPolicy:
mode: user-defined
allowedTypes: "*"
maxFields: 16
dynamicPropertyPolicy:
mode: user-defined
allowedTypes: "*"
maxFields: 16属性
| 属性 | 类型 | 必填 | 描述 |
|---|---|---|---|
resolver | { function: string } 或 { endpoint: string } | Y | 定义扩展模块所使用的处理函数: - 指定后端处理函数时使用 function 属性 - 指定远程服务时使用 endpoint 属性 |
title | string | i18n | Y | 定义扩展模块动作的标题 |
icon | string | 定义扩展模块动作的图标 | |
description | string | i18n | 定义扩展模块动作的描述 | |
resource | string | Y | 定义扩展模块所使用的资源,内容为 resources 节点的资源引用 |
inputPolicy | object | Y | 定义扩展模块的输入参数策略配置 |
inputPolicy.mode | string | Y | 定义扩展模块的输入参数策略模式, fixed (固定字段), user-defined (用户自定义) |
inputPolicy.allowedTypes | array[] | Y | 定义扩展模块的输入参数策略允许的字段类型 |
inputSchema | array[] | Y | 定义扩展模块的输入参数 |
inputSchema.key | string | Y | 定义扩展模块输入字段唯一标识 |
inputSchema.title | string | i18n | Y | 定义扩展模块输入字段标题 |
inputSchema.type | string | Y | 定义扩展模块输入字段数据类型, 当前支持的类型详情请参考XXX |
inputSchema.required | boolean | Y | 定义扩展模块输入字段的值是否允许为空, 默认 true |
dynamicPropertyPolicy | object | Y | 定义扩展模块的动态数据策略配置 |
dynamicPropertyPolicy.mode | string | Y | 定义扩展模块的动态数据策略模式, fixed (固定字段), user-defined (用户自定义) |
dynamicPropertyPolicy.allowedTypes | array[] | Y | 定义扩展模块的动态数据策略允许的字段类型 |
dynamicPropertySchema | array[] | Y | 定义扩展模块的动态数据,输出变量可供后续自动化节点引用 |
dynamicPropertySchema.key | string | Y | 定义扩展模块的动态数据唯一标识 |
dynamicPropertySchema.title | string | i18n | Y | 定义扩展模块的动态数据标题 |
dynamicPropertySchema.type | string | Y | 定义扩展模块的动态数据类型 , 当前支持的类型详情请参考XXX |
dynamicPropertySchema.required | boolean | Y | 定义扩展模块的动态数据的值是否允许为空, 默认 false |
| 属性 | 类型 | 必填 | 描述 |
|---|---|---|---|
resolver | { function: string } 或 { endpoint: string } | Y | 定义扩展模块所使用的处理函数: - 指定后端处理函数时使用 function 属性 - 指定远程服务时使用 endpoint 属性 |
title | string | i18n | Y | 定义扩展模块动作的标题 |
icon | string | 定义扩展模块动作的图标 | |
description | string | i18n | 定义扩展模块动作的描述 | |
resource | string | Y | 定义扩展模块所使用的资源,内容为 resources 节点的资源引用 |
inputPolicy | object | Y | 定义扩展模块的输入参数策略配置 |
inputPolicy.mode | string | Y | 定义扩展模块的输入参数策略模式, fixed (固定字段), user-defined (用户自定义) |
inputPolicy.allowedTypes | string | Y | 定义扩展模块的输入参数允许的字段类型 |
inputPolicy.maxFields | number | Y | 定义扩展模块最多可支持的输入参数数量上限 |
dynamicPropertyPolicy | object | Y | 定义扩展模块的动态数据策略配置 |
dynamicPropertyPolicy.mode | string | Y | 定义扩展模块的动态数据策略模式, fixed (固定字段), user-defined (用户自定义) |
dynamicPropertyPolicy.allowedTypes | string | Y | 定义扩展模块的动态数据允许的字段类型 |
dynamicPropertyPolicy.maxFields | number | Y | 定义扩展模块的最多可支持的动态数据数量上限 |
扩展数据
当前模块可访问的扩展数据:
| 数据 | 说明 |
|---|---|
限制
每个扩展模块对应的数量限制:
| 资源 | 限制 | 说明 |
|---|---|---|
| 扩展模块数量 | 8 | 单个应用可以声明的当前扩展模块最大数量 |
桥接方法
当前扩展模块不支持以下桥接方法,详情请参考 view 。
| 桥接方法 | 支持 |
|---|---|