Skip to content

工作流 - 动作 ​

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

image.png

image.png

image.png

image.png

配置 ​

配置结构:

支持两种策略模式: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 属性
titlestring | i18nY定义扩展模块动作的标题
iconstring定义扩展模块动作的图标
descriptionstring | i18n定义扩展模块动作的描述
resourcestringY定义扩展模块所使用的资源,内容为 resources 节点的资源引用
inputPolicyobjectY定义扩展模块的输入参数策略配置
inputPolicy.modestringY定义扩展模块的输入参数策略模式, fixed (固定字段), user-defined (用户自定义)
inputPolicy.allowedTypesarray[]Y定义扩展模块的输入参数策略允许的字段类型
inputSchemaarray[]Y定义扩展模块的输入参数
inputSchema.keystringY定义扩展模块输入字段唯一标识
inputSchema.titlestring | i18nY定义扩展模块输入字段标题
inputSchema.typestringY定义扩展模块输入字段数据类型, 当前支持的类型详情请参考XXX
inputSchema.requiredbooleanY定义扩展模块输入字段的值是否允许为空, 默认 true
dynamicPropertyPolicyobjectY定义扩展模块的动态数据策略配置
dynamicPropertyPolicy.modestringY定义扩展模块的动态数据策略模式, fixed (固定字段), user-defined (用户自定义)
dynamicPropertyPolicy.allowedTypesarray[]Y定义扩展模块的动态数据策略允许的字段类型
dynamicPropertySchemaarray[]Y定义扩展模块的动态数据,输出变量可供后续自动化节点引用
dynamicPropertySchema.keystringY定义扩展模块的动态数据唯一标识
dynamicPropertySchema.titlestring | i18nY定义扩展模块的动态数据标题
dynamicPropertySchema.typestringY定义扩展模块的动态数据类型 , 当前支持的类型详情请参考XXX
dynamicPropertySchema.requiredbooleanY定义扩展模块的动态数据的值是否允许为空, 默认 false
属性类型必填描述
resolver{ function: string } 或 { endpoint: string }Y定义扩展模块所使用的处理函数: - 指定后端处理函数时使用 function 属性 - 指定远程服务时使用 endpoint 属性
titlestring | i18nY定义扩展模块动作的标题
iconstring定义扩展模块动作的图标
descriptionstring | i18n定义扩展模块动作的描述
resourcestringY定义扩展模块所使用的资源,内容为 resources 节点的资源引用
inputPolicyobjectY定义扩展模块的输入参数策略配置
inputPolicy.modestringY定义扩展模块的输入参数策略模式, fixed (固定字段), user-defined (用户自定义)
inputPolicy.allowedTypesstringY定义扩展模块的输入参数允许的字段类型
inputPolicy.maxFieldsnumberY定义扩展模块最多可支持的输入参数数量上限
dynamicPropertyPolicyobjectY定义扩展模块的动态数据策略配置
dynamicPropertyPolicy.modestringY定义扩展模块的动态数据策略模式, fixed (固定字段), user-defined (用户自定义)
dynamicPropertyPolicy.allowedTypesstringY定义扩展模块的动态数据允许的字段类型
dynamicPropertyPolicy.maxFieldsnumberY定义扩展模块的最多可支持的动态数据数量上限

扩展数据 ​

当前模块可访问的扩展数据:

数据说明

限制 ​

每个扩展模块对应的数量限制:

资源限制说明
扩展模块数量8单个应用可以声明的当前扩展模块最大数量

桥接方法 ​

当前扩展模块不支持以下桥接方法,详情请参考 view 。

桥接方法支持

举报邮箱:abuse@worktile.com