fxapi-workflow-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

工作流管理技能

Workflow Management Skill

fx-api-cli
是提供的命令行程序,所有操作通过执行
fx-api-cli
命令完成。
通过
fx-api-cli workflow <接口名> '<json入参>'
与工作流管理系统交互。

fx-api-cli
is the provided command-line program, all operations are completed by executing the
fx-api-cli
command.
Interact with the workflow management system via
fx-api-cli workflow <interface name> '<json input parameters>'
.

接口列表

API List

workflow.instance.comment_list — 工作流实例评论列表接口

workflow.instance.comment_list — Workflow Instance Comment List API

bash
fx-api-cli workflow instance_comment_list '{"instance_id": "instance_id_1"}'
获取工作流实例的评论列表。需要指定实例 ID。参见 API 详情
bash
fx-api-cli workflow instance_comment_list '{"instance_id": "instance_id_1"}'
Get the comment list of a workflow instance. The instance ID is required. See API Details.

workflow.instance.get — 工作流实例详情接口

workflow.instance.get — Workflow Instance Details API

bash
fx-api-cli workflow instance_get '{"instance_id": "instance_id_1"}'
获取工作流实例的详细信息。需要指定实例 ID。参见 API 详情
bash
fx-api-cli workflow instance_get '{"instance_id": "instance_id_1"}'
Get detailed information of a workflow instance. The instance ID is required. See API Details.

workflow.instance.log_list — 工作流实例日志列表接口

workflow.instance.log_list — Workflow Instance Log List API

bash
fx-api-cli workflow instance_log_list '{"instance_id": "instance_id_1"}'
获取工作流实例的日志列表。需要指定实例 ID。参见 API 详情
bash
fx-api-cli workflow instance_log_list '{"instance_id": "instance_id_1"}'
Get the log list of a workflow instance. The instance ID is required. See API Details.

workflow.instance.close — 工作流实例关闭接口

workflow.instance.close — Workflow Instance Close API

bash
fx-api-cli workflow instance_close '{"instance_id": "instance_id_1"}'
关闭工作流实例。需要指定实例 ID。参见 API 详情
bash
fx-api-cli workflow instance_close '{"instance_id": "instance_id_1"}'
Close a workflow instance. The instance ID is required. See API Details.

workflow.instance.activate — 工作流实例激活接口

workflow.instance.activate — Workflow Instance Activate API

bash
fx-api-cli workflow instance_activate '{"instance_id": "instance_id_1"}'
激活工作流实例。需要指定实例 ID。参见 API 详情
bash
fx-api-cli workflow instance_activate '{"instance_id": "instance_id_1"}'
Activate a workflow instance. The instance ID is required. See API Details.

workflow.task.list — 工作流任务列表接口

workflow.task.list — Workflow Task List API

bash
fx-api-cli workflow task_list '{"app_id": "app_id_1", "entry_id": "entry_id_1"}'
获取工作流任务列表。支持按应用 ID 和表单 ID 过滤。参见 API 详情
bash
fx-api-cli workflow task_list '{"app_id": "app_id_1", "entry_id": "entry_id_1"}'
Get the workflow task list. Support filtering by application ID and form ID. See API Details.

workflow.task.approve — 工作流任务审批接口

workflow.task.approve — Workflow Task Approval API

bash
fx-api-cli workflow task_approve '{"task_id": "task_id_1", "remark": "批准"}'
审批工作流任务。需要指定任务 ID 和审批意见。参见 API 详情
bash
fx-api-cli workflow task_approve '{"task_id": "task_id_1", "remark": "Approved"}'
Approve a workflow task. The task ID and approval opinion are required. See API Details.

workflow.task.rollback — 工作流任务回退接口

workflow.task.rollback — Workflow Task Rollback API

bash
fx-api-cli workflow task_rollback '{"task_id": "task_id_1", "remark": "回退"}'
回退工作流任务。需要指定任务 ID 和回退意见。参见 API 详情
bash
fx-api-cli workflow task_rollback '{"task_id": "task_id_1", "remark": "Rollback"}'
Roll back a workflow task. The task ID and rollback opinion are required. See API Details.

workflow.task.transfer — 工作流任务转交接口

workflow.task.transfer — Workflow Task Transfer API

bash
fx-api-cli workflow task_transfer '{"task_id": "task_id_1", "user_id": "user_id_1", "remark": "转交"}'
转交工作流任务。需要指定任务 ID、接收人 ID 和转交意见。参见 API 详情
bash
fx-api-cli workflow task_transfer '{"task_id": "task_id_1", "user_id": "user_id_1", "remark": "Transfer"}'
Transfer a workflow task. The task ID, recipient ID and transfer opinion are required. See API Details.

workflow.task.add_sign — 工作流任务加签接口

workflow.task.add_sign — Workflow Task Add Signer API

bash
fx-api-cli workflow task_add_sign '{"task_id": "task_id_1", "user_id": "user_id_1", "remark": "加签"}'
为工作流任务添加加签人。需要指定任务 ID、加签人 ID 和加签意见。参见 API 详情
bash
fx-api-cli workflow task_add_sign '{"task_id": "task_id_1", "user_id": "user_id_1", "remark": "Add signer"}'
Add a signer to the workflow task. The task ID, signer ID and signing opinion are required. See API Details.

workflow.task.revoke — 工作流任务撤回接口

workflow.task.revoke — Workflow Task Revoke API

bash
fx-api-cli workflow task_revoke '{"task_id": "task_id_1", "remark": "撤回"}'
撤回工作流任务。需要指定任务 ID 和撤回意见。参见 API 详情
bash
fx-api-cli workflow task_revoke '{"task_id": "task_id_1", "remark": "Revoke"}'
Revoke a workflow task. The task ID and revocation opinion are required. See API Details.

workflow.task.reject — 工作流任务拒绝接口

workflow.task.reject — Workflow Task Reject API

bash
fx-api-cli workflow task_reject '{"task_id": "task_id_1", "remark": "拒绝"}'
拒绝工作流任务。需要指定任务 ID 和拒绝意见。参见 API 详情
bash
fx-api-cli workflow task_reject '{"task_id": "task_id_1", "remark": "Reject"}'
Reject a workflow task. The task ID and rejection opinion are required. See API Details.

workflow.cc.list — 工作流抄送列表接口

workflow.cc.list — Workflow CC List API

bash
fx-api-cli workflow cc_list '{"instance_id": "instance_id_1"}'
获取工作流实例的抄送列表。需要指定实例 ID。参见 API 详情

bash
fx-api-cli workflow cc_list '{"instance_id": "instance_id_1"}'
Get the CC list of a workflow instance. The instance ID is required. See API Details.

核心规则

Core Rules

实例 ID 查找规则

Instance ID Search Rule

  • 当用户需要操作工作流实例但未提供实例 ID 时:
    1. 调用
      workflow.task.list
      获取任务列表
    2. 从任务列表中提取实例 ID
    3. 匹配策略
      • 精确匹配唯一结果:直接使用
      • 模糊匹配多个结果:展示候选列表让用户选择
      • 无匹配结果:告知用户未找到
  • When the user needs to operate a workflow instance but does not provide the instance ID:
    1. Call
      workflow.task.list
      to get the task list
    2. Extract the instance ID from the task list
    3. Matching Strategy:
      • Exact match with unique result: use directly
      • Fuzzy match with multiple results: display candidate list for user to choose
      • No matching result: inform the user that no result is found

任务 ID 查找规则

Task ID Search Rule

  • 当用户需要操作工作流任务但未提供任务 ID 时:
    1. 调用
      workflow.task.list
      获取任务列表
    2. 根据用户提供的条件(如任务状态、创建时间等)过滤任务
    3. 匹配策略
      • 精确匹配唯一结果:直接使用
      • 模糊匹配多个结果:展示候选列表让用户选择
      • 无匹配结果:告知用户未找到
  • When the user needs to operate a workflow task but does not provide the task ID:
    1. Call
      workflow.task.list
      to get the task list
    2. Filter tasks according to the conditions provided by the user (such as task status, creation time, etc.)
    3. Matching Strategy:
      • Exact match with unique result: use directly
      • Fuzzy match with multiple results: display candidate list for user to choose
      • No matching result: inform the user that no result is found

审批规则

Approval Rules

  • 审批意见:审批、拒绝、回退等操作必须提供审批意见
  • 操作确认:执行审批、拒绝、关闭等操作前必须向用户确认

  • Approval Opinion: Operations such as approval, rejection, and rollback must provide approval opinions
  • Operation Confirmation: You must confirm with the user before performing operations such as approval, rejection, and closing

典型工作流

Typical Workflows

查询工作流实例详情

Query Workflow Instance Details

用户query示例
  • "帮我查询工作流实例详情"
  • "查看工作流实例信息"
执行流程
  1. 通过 实例 ID 查找规则 确定目标实例的
    instance_id
  2. 调用
    workflow.instance.get
    获取实例详情
  3. 展示实例的状态、创建时间、发起人等信息
User query examples:
  • "Help me query the details of the workflow instance"
  • "View workflow instance information"
Execution Process:
  1. Determine the
    instance_id
    of the target instance through the Instance ID Search Rule
  2. Call
    workflow.instance.get
    to get the instance details
  3. Display the instance status, creation time, initiator and other information

查询工作流实例日志

Query Workflow Instance Logs

用户query示例
  • "帮我查询工作流实例日志"
  • "查看工作流实例的操作记录"
执行流程
  1. 通过 实例 ID 查找规则 确定目标实例的
    instance_id
  2. 调用
    workflow.instance.log_list
    获取日志列表
  3. 展示每条日志的操作时间、操作人、操作类型和操作内容
User query examples:
  • "Help me query the workflow instance logs"
  • "View the operation records of the workflow instance"
Execution Process:
  1. Determine the
    instance_id
    of the target instance through the Instance ID Search Rule
  2. Call
    workflow.instance.log_list
    to get the log list
  3. Display the operation time, operator, operation type and operation content of each log

查询工作流任务列表

Query Workflow Task List

用户query示例
  • "帮我查询工作流任务"
  • "查看待处理的工作流任务"
执行流程
  1. 确定查询参数(应用 ID、表单 ID、任务状态等)
  2. 调用
    workflow.task.list
    获取任务列表
  3. 展示每个任务的任务 ID、状态、创建时间、处理人等信息
User query examples:
  • "Help me query workflow tasks"
  • "View pending workflow tasks"
Execution Process:
  1. Determine query parameters (application ID, form ID, task status, etc.)
  2. Call
    workflow.task.list
    to get the task list
  3. Display the task ID, status, creation time, processor and other information of each task

审批工作流任务

Approve Workflow Task

用户query示例
  • "帮我审批这个工作流任务"
  • "批准这条工作流"
执行流程
  1. 通过 任务 ID 查找规则 确定目标任务的
    task_id
  2. 收集用户提供的审批意见
  3. 向用户确认审批操作
  4. 调用
    workflow.task.approve
    审批任务
  5. 展示审批结果
User query examples:
  • "Help me approve this workflow task"
  • "Approve this workflow"
Execution Process:
  1. Determine the
    task_id
    of the target task through the Task ID Search Rule
  2. Collect the approval opinion provided by the user
  3. Confirm the approval operation with the user
  4. Call
    workflow.task.approve
    to approve the task
  5. Display the approval result

拒绝工作流任务

Reject Workflow Task

用户query示例
  • "帮我拒绝这个工作流任务"
  • "拒绝这条工作流"
执行流程
  1. 通过 任务 ID 查找规则 确定目标任务的
    task_id
  2. 收集用户提供的拒绝意见
  3. 向用户确认拒绝操作
  4. 调用
    workflow.task.reject
    拒绝任务
  5. 展示拒绝结果
User query examples:
  • "Help me reject this workflow task"
  • "Reject this workflow"
Execution Process:
  1. Determine the
    task_id
    of the target task through the Task ID Search Rule
  2. Collect the rejection opinion provided by the user
  3. Confirm the rejection operation with the user
  4. Call
    workflow.task.reject
    to reject the task
  5. Display the rejection result

转交工作流任务

Transfer Workflow Task

用户query示例
  • "帮我转交这个工作流任务"
  • "把任务转交给其他人"
执行流程
  1. 通过 任务 ID 查找规则 确定目标任务的
    task_id
  2. 收集用户提供的接收人 ID 和转交意见
  3. 向用户确认转交操作
  4. 调用
    workflow.task.transfer
    转交任务
  5. 展示转交结果

User query examples:
  • "Help me transfer this workflow task"
  • "Transfer the task to someone else"
Execution Process:
  1. Determine the
    task_id
    of the target task through the Task ID Search Rule
  2. Collect the recipient ID and transfer opinion provided by the user
  3. Confirm the transfer operation with the user
  4. Call
    workflow.task.transfer
    to transfer the task
  5. Display the transfer result

错误处理

Error Handling

  • 实例未找到:明确告知用户未找到对应工作流实例
  • 任务未找到:明确告知用户未找到对应工作流任务
  • 权限不足:明确告知用户无权限执行操作
  • API错误:展示具体错误信息,必要时重试
  • 网络问题:HTTP错误时主动重试最多3次
  • Instance not found: Clearly inform the user that the corresponding workflow instance is not found
  • Task not found: Clearly inform the user that the corresponding workflow task is not found
  • Insufficient permissions: Clearly inform the user that they have no permission to perform the operation
  • API error: Display specific error information, retry if necessary
  • Network problem: Actively retry up to 3 times when HTTP error occurs