Skip to content
Back to skills

Ontoplato Workflow Admin

ASecurity

以域管理员身份维护 OntoPlato 域内概念组件并固化业务流程:对象类型/属性/关系、指标/函数/动作、Workflow 固定流程与 Case 临时流程、actorPolicy 派单与 caseScoped 执行边界、Praxis multiSource 账本双源、任务触发(Trigger)与静态/动态验收。

  • 13 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythongobashnodeapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add ontomato-ai/OntoPlato --skill ontoplato-workflow-admin --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ontoplato Workflow Admin?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ontoplato Workflow Admin
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ontomato-ai-ontoplato-workflow-admin-ontoplato/badge)](https://www.skillsdirectory.com/skills/ontomato-ai-ontoplato-workflow-admin-ontoplato)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ontoplato-workflow-admin
description: "以域管理员身份维护 OntoPlato 域内概念组件并固化业务流程:对象类型/属性/关系、指标/函数/动作、Workflow 固定流程与 Case 临时流程、actorPolicy 派单与 caseScoped 执行边界、Praxis multiSource 账本双源、任务触发(Trigger)与静态/动态验收。"
compatibility: Node.js 24+
---

# 流程编排

本技能负责 OntoPlato 域内的**概念组件维护与流程编排交付**:维护事实层、能力层与流程相关授权衔接,将业务流程定义为可发布、可授权的固定流程或 Case 型临时流程,配置 Praxis 账本双源与任务触发,并完成静态与动态验收。

- **日常发起、待办审批与办理**:使用 `ontoplato-workflow-operator`,本技能不执行日常业务 Action。
- **权限体系完整配置**(组织树、成员、岗位、角色、三类策略、行/字段数据权限、API Key、外部身份同步):详见 `ontoplato-permission`,本技能仅说明流程步骤授权衔接要点。
- **Action 与 MetricView 函数包开发规范及 Action 三步发布闭环**(`# ontomato-python:2`、`save -> trial -> publish`):唯一权威规范见 `ontoplato-capability-builder`。

OntoPlato 负责定义、发布和授权能力;Ontopraxis(Praxis)把生效的 Workflow 编译成冻结的 RunTemplate,维护 Run/Step 状态并驱动步骤流转。两边需同时成立:

| 要素 | 作用 | 不是 |
| --- | --- | --- |
| `Workflow` + 步骤 | **定义与授权的发布单元**:Praxis 用生效版本编译 RunTemplate,OntoPlato 同步落“角色 × 动作”授权 | 不是业务事实类,也不是 Action 本身 |
| 步骤里的 `Action` | 真正干活的写函数;谁能跑、何时能跑的业务条件写在它自己身上 | 不是流程节点 |
| 步骤里的 `roleCode` | 授权主体:激活时按 `roleName` 解析为域内角色 | 不是人名 |
| `runContract` | 业务运行对象上的字段投影:单号 / 当前节点 / 状态 / 负责人 | 不是表结构 |

核心运行时规则:

- **固定逻辑步骤**:Praxis 按冻结模板自动调用 OntoPlato Action,当前以 Run `requester` 作为执行主体。
- **人工步骤**:Praxis 建 Run/Step 后等待办理。`actorPolicy.mode=none` 保持角色池;`rule` / `agent` 在进入 `waiting` 前解析出具体承办人。
- **承办人改钉**:Praxis 提供 step assignment 接口;已钉住的步骤仅当前承办人、Run `requester` 或管理角色可改钉,同角色成员不可抢单。
- **业务前置条件仍在 Action**:Praxis 管理运行账本和承办人,Action 的 `submissionCriteria` 继续判定业务对象是否处于可办理状态。
- **域开通自动完成**:新域创建后,OntoPlato 后台自动调用 Praxis 内部开通接口写入全局注册表、创建 `ledger_<domainId>` schema 并热加载;不要新增域环境变量,也不要重启 Praxis。

当前工作流管理页对**已有流程仅提供“查看”**,修改流程定义必须通过本技能的 `wf-save` 接口,不要把页面“编辑”当成写入路径。

---

## 连接方式与前置条件

- 运行环境需具备 Node.js 24+(脚本只使用 Node 内置模块),且目标 OntoPlato 服务已部署、持有**域管理员**账号。
- **对象创建前置授权**:新建 Action 与 Workflow 要求当前账号角色持有 `ACTION` 与 `WORKFLOW` 的 `CREATE` 对象授权(如遇 `403 CREATE_FORBIDDEN`,请先按 `ontoplato-permission` 的 `postType=3` 入口与对象策略接口 `POST /authorization/policies/entries:grant` 或 `/governance/policies` 为角色补齐 `CREATE` 授权)。
- **多数据源生效边界**:通过 `praxis-multisource-save` / `datasource-multi` 切换或更新 `multiSource` 后,运行中的数据引擎必须重启后才会建立新连接;账本只读角色 `ontopraxis_reader_<domainId>` 的密码由部署运维提供,不由此 CLI 创建。
- 下文 `<this-skill>` 表示本技能 `SKILL.md` 所在目录;JSON 参数支持内联 JSON(`{...}`)、文件路径(`file.json`)或 `@file.json`;所有写命令均支持 `--dry-run`(纯本地打印请求,不登录、不访问服务端、不落库)。
- 端点配置(以平台前端基础地址 `ONTOMATO_URL` / `<envUrl>` 如 `http://host:3000` 为准,缺省时回退读取当前目录或技能目录 `application.yml`):
  - `ONTOMATO_ONTOLOGY_URL`(或 `OA_BASE`):数据引擎入口,默认 `<envUrl>/api/data-query`;
  - `ONTOMATO_PRAXIS_URL`(或 `PRAXIS_BASE`):Praxis 入口,默认 `<envUrl>/api/praxis`;
  - `ONTOMATO_WORKBENCH_URL`(可选覆盖):工作台根地址 `<envUrl>`(脚本自动补齐 `/api`);
  - 仅在用户名 + 密码模式下可配置 `OA_AUTH`(默认 `<envUrl>/api/data-query/sso` 或部署指定的认证入口)。
- 认证方式(无默认账号;优先级:平台托管回调 `ONTOMATO_EXECUTION_CALLBACK` > 命令行参数 `--token` / `--api-key` / `--user`+`--password` > 环境变量 `ONTOMATO_API_KEY` > `ONTOMATO_TK` > `OA_CODE`+`OA_PASS`+`OA_DOMAIN` > `application.yml`):
  1. **OntoPlato API Key**:`ONTOMATO_API_KEY`(兼容 `OA_API_KEY`)或 `--api-key <key>`;
  2. **平台 token**:`ONTOMATO_TK`(兼容 `OA_TOKEN`)或命令行 `--token <tk>`;
  3. **用户名 + 密码**:`OA_CODE` + `OA_PASS` + `OA_DOMAIN` 或 `--user` / `--password` / `--domain`。
- 在平台 Agent 运行时内,宿主会自动注入回调地址与凭据;平台外运行时配置环境变量或 `application.yml` 即可,命令用法完全一致。

```bash
node <this-skill>/scripts/client.mjs ping
node <this-skill>/scripts/client.mjs me
node <this-skill>/scripts/client.mjs subjects
```

`ping` 连不上时先排查服务环境,不要继续修改流程定义。

---

## 1. 概念组件维护范围

本技能维护**应用层以外的本体概念组件**(事实层、能力层与治理层衔接);应用、面板、投影及产品层智能体定义由 `ontoplato-app-builder` / `ontoplato-agent-builder` 负责。

| 层级 | 维护入口 |
| --- | --- |
| 事实层 | `/ontology/objects`、`/ontology/attributes`、`/ontology/relations`、`/ontology/knowledge`、`/ontology/visual-modeling` |
| 能力层 | `/ontology/assets/metrics`、`/ontology/assets/functions`、`/ontology/assets/actions`、`/ontology/assets/workflows`、`/ontology/assets/triggers`、`/ontology/skills` |
| 跨层只读核对 | `/ontology/assets/capability-map` |
| 治理层 | `/permissions/members`、`/permissions/roles`、`/permissions/policies`、`/permissions/organization` |

对象类型、属性、关系、指标、函数、技能的命令与保存后回读顺序见[概念组件维护](references/concept-components.md)。业务知识写入请走 `ontoplato-knowledge-governance`,不要绕过治理流程。

---

## 2. 业务库 + Praxis 账本 `multiSource`

OntoPlato 的 `multi` 适配器将业务对象路由到业务库,将 Run / Case / Assignment / Step / Decision 路由到 Praxis 账本库 `ledger_<domainId>`。保存前先确认域已自动开通:

```bash
node <this-skill>/scripts/client.mjs domain-praxis-check <domainId>
node <this-skill>/scripts/client.mjs praxis-multisource-save @praxis-multisource.json
node <this-skill>/scripts/client.mjs praxis-multisource-check
```

完整载荷、7 个只读视图、连接约束与跨源验收见[业务库与 Praxis 账本 multiSource](references/praxis-multisource.md)。核心要点:

- `business` 源可写(`readOnly=false`);`ledger` 源必须只读(`readOnly=true`)且使用数据库只读 `reader` 角色。
- 最新 Praxis 账本包含 **7 个只读视图**:`workflow_run`、`workflow_case`、`assignment_request`、`step_run`、`approval_decision`、`model_decision`、`context_assembly`(不要沿用旧的 5 视图清单)。
- 每个本体类只能路由到一个源,不可重名或嵌套 `multi`;跨源不能 JOIN,需先按 `workflow_run.acts_on_class` / `acts_on_id` 查 Run,再查业务对象。
- 保存 `multiSource` 后,运行中的数据引擎必须重启才会切换新连接。

---

## 3. 与权限体系的衔接(详述见 `ontoplato-permission`)

流程步骤通过角色和组织范围衔接平台权限体系,开始编排前需确认以下事实(完整组织树、成员、岗位、角色、行/字段数据权限、API Key 与外部身份同步配置均见 `ontoplato-permission`):

- **三类权限策略(`PolicyTypes`)**:
  - `postType=1`:**管理操作策略**,逐项授予平台管理操作的查看/更改;
  - `postType=2`:**业务数据策略**,配置域内对象类的行/字段数据权限(`fullData=1` 表示全部业务数据权限);
  - `postType=3`:**入口与对象策略**,授予具体入口及入口带出的面板、投影、组件、智能体、动作和指标。
- **角色与步骤绑定**:流程步骤的 `roleCode` 必须在域内已有角色(`roleName`)中存在,且该角色至少有有效成员(通过 `role-members` 直接加入,或通过组织授权 `grant-save` 在 `organization` / `subtree` / `position` 上授予角色)。普通业务角色使用 `roleType=0`,不要随意创建管理角色(`roleType=1`)。
- **步骤 `scope` 与组织授权协同**:当步骤使用 `self_organization` / `self_subtree` / `self_descendants` 范围时,要求运行对象声明 `runContract.orgField`,且办理人处于对应的组织树结构中。
- 验收期若仅有管理员账号,可临时将其加入步骤角色(`role-members`),验收后立即恢复,不要永久留权。

---

## 4. 流程 Action 设计约束

一条 N 步流程通常需要 **N+1 个动作**:1 个发起动作 + 每步 1 个办理动作。

函数包结构(`# ontomato-python:2`)、参数规范以及平台统一的 **Action 三步发布闭环(`save -> trial -> publish`)** 请严格遵循 `ontoplato-capability-builder`。此处仅列出流程编排特有的硬约束与本客户端快捷命令:

- 每个动作内嵌 `function`(`operation` 为 `OPERATION_WRITE`,代码以 `function.files` 提交,入口 `main.py` 首行 `# ontomato-python:2`);发布(`PUBLISHED`)后文件包冻结,要改须新建动作。
- 审批动作必须接受 `run_id`(业务对象 ID)、`decision`(`approved` / `rejected`)、`comment`,并回写业务状态、当前节点与审批人;通过 `submissionCriteria` 判定“当前是否轮到本步骤办理”。
- `approvalMode` 取 `auto | human | twoKeys`;`twoKeys` 当前无双人实现,仅编译为普通 `human` 步。
- **创建型 Action 输出契约**:必须 `print(json.dumps({...}, ensure_ascii=False))` 并返回 `targetClass` 与 `run_id`(或 `id`),供 Praxis 自动绑定新业务对象;仅返回 `{"completed": true}` 会导致后续 `$business.*` 派单和审批全部断链。
- **声明参数全部必填**:`function.parameters` 中声明的每个参数都是必填,Python 中的 `or 默认值` 不能将其变为可选。人工 `decide` 无法临时补参数,页面流程须通过步骤输入预先绑定,或省略声明由脚本内部生成。
- **申请单与任职/事实历史分离**:岗位、职称、职务晋升等审批不得在发起时预写历史事实表(如 `tech_gwdj` 仅保存真实生效的现任与历任记录),应单独建申请类(如 `tech_gwdj_apply`)作为 `runClassName`,在最终审批通过的 Action 中再关闭旧历史并新增真实现任记录;规则派单绑定申请类字段(如 `$business.target_hj_dj`)。
- **Action 内调用 Praxis**:必须使用运行时注入的 `query_runtime` 中 `praxis_*` 脚手架,严禁手写端口或拼接 URL,严禁把 `ONTOMATO_CALLER_TK` 声明为参数或输出到业务对象与日志中。承办主体参数须传 `praxis_step_candidates()` 返回的 `principal`(通常为 `loginCode`)。沙箱试跑携带真实调用人 token,调用 Praxis 可能产生外部副作用,重试前先按业务 ID 查重。完整函数契约见[Action 中的 Praxis 脚手架](references/praxis-helpers.md)。

本客户端执行的 Action 三步闭环命令(各闸门与拒码详述见 `ontoplato-capability-builder`):

```bash
node <this-skill>/scripts/client.mjs actions
node <this-skill>/scripts/client.mjs action-save ./action.json                     # 1. 存草稿(新建省略 id)
node <this-skill>/scripts/client.mjs action-trial <actionId> @trial-payload.json   # 2. 沙箱试跑(POST /action/trial)
node <this-skill>/scripts/client.mjs action-get <actionId>                         #    核对解读就绪与 trialStatus=passed
node <this-skill>/scripts/client.mjs action-reexplain '{"ids":["<actionId>"],"missingOnly":true}'
node <this-skill>/scripts/client.mjs action-publish <actionId>                     # 3. 发布(POST /action/setStatus)
node <this-skill>/scripts/client.mjs action-retire <actionId>                      # 退休置为 UNUSED(不删)
```

---

## 5. 编排固定流程(Workflow)

### 5.1 先定七项业务决策

1. **运行对象**:单次流转承载什么业务单据(如 `leave_request`)→ 事实层类 + 主键 + 业务字段。
2. **`runContract`**:单号 / 当前节点 / 状态 / 负责人在运行类上的字段映射。
3. **步骤序列**:先后顺序,以及每步是审批(`approve`)还是执行(`execute`)。
4. **每步角色**:使用域内已有 `roleName` 作为步骤 `roleCode`。
5. **授权范围(`scope`)**:`all` / `self_organization` / `self_subtree` / `self_descendants` / `initiated_by_self` / `assigned_to_self`。
6. **承办人策略(`actorPolicy`)与 `caseScoped`**:角色池领取(`none`)、规则派单(`rule`)或智能体派单(`agent`),以及是否收紧到当前承办人独占执行。
7. **提交要件**:发起必填项与由平台/脚本自动计算的字段。

### 5.2 `runContract`

```json
{
  "className": "leave_request",
  "idField": "id",
  "stepField": "current_node",
  "statusField": "status",
  "statusOpen": ["待办"],
  "statusDone": ["已完成"],
  "statusRejected": ["已驳回"],
  "assigneeField": "assignee_id",
  "orgField": "dept",
  "initiatorField": "applicant_id",
  "candidateField": "candidate_ids",
  "workflowRefField": "workflow_id"
}
```

- `idField` 缺省为 `id`;其余字段缺省表示对应投影能力不可用。
- `stepField` 与 `statusField` 必须是不同属性;`statusOpen` 至少一个值;开放 / 完成 / 驳回三组状态值不得重叠;激活时逐字段对照类定义校验。
- 声明 `runContract` 后,激活会自动生成“我的待办”“单据详情”两个已发布 MetricView。
- 多个流程共用同一运行类时,必须声明 `workflowRefField`,并由发起 Action 写入流程 ID。
- `scope` 使用 `self_organization` / `self_subtree` / `self_descendants` 须声明 `orgField`;`initiated_by_self` 须声明 `initiatorField`;`assigned_to_self` 须声明 `assigneeField`。

### 5.3 步骤定义、`actorPolicy` 与 `caseScoped`(唯一权威口径)

```json
{
  "name": "请假申请",
  "description": "公司固定请假流程",
  "runClassName": "leave_request",
  "runContract": { "...": "..." },
  "steps": [
    {
      "stepNo": 1,
      "name": "提交申请",
      "roleCode": "DEPARTMENT_EMPLOYEE",
      "actionId": "act_leave_start",
      "actionType": "execute",
      "scope": "all",
      "description": "申请人提交"
    },
    {
      "stepNo": 2,
      "name": "部门领导审批",
      "roleCode": "DEPT_LEADER",
      "actionId": "act_leave_approve",
      "actionType": "approve",
      "scope": "self_subtree",
      "actorPolicy": { "mode": "none" },
      "invocationMode": "manual",
      "description": "审批本部门子树内的申请"
    }
  ]
}
```

`WorkflowStep` 真实字段:`stepNo` / `name` / `roleCode` / `actionId` / `actionType` / `scope` / `description` / `actorPolicy` / `invocationMode` / `inputBindings` / `locked` / `caseScoped`。平台**不返回**步骤级 `input` / `executor` / `assignee` / `decider`(这些是运行时输入,不是流程定义)。

- **`name` 唯一**:步骤 `name` 非空且在流程内互不重复。
- **`roleCode` 解析**:空 `roleCode` 保存时即拒绝;域内是否存在该角色在**激活时**解析,缺失报 `The workflow names a role that does not exist in this domain: X`。
- **`actionType=approve`**:强制该步为 `human`,即便 Action 写 `auto`。
- **`scope`**:表示授权数据范围,不等于“当前负责人”。
- **`actorPolicy` 仅对 `human` 步骤生效**(`fixed` 步骤由 Praxis 按模板直接执行,不走 rule/agent 派单):
  - `mode: "none"`:角色池自行领取。
  - `mode: "rule"`:必须提供 `metricViewId` 与 `metricRevision`;`principalField` 默认 `principal`,返回值可经 `valueMap` 映射后校验是否属于步骤候选集。支持 `parameterBindings` 将冻结上下文映射到 MetricView 参数(`$run.id`、`$run.templateRef`、`$run.requester`、`$step.id`、`$step.ref`、`$step.roleCode`、`$business.className`、`$business.id`、`$business.<字段>`,覆盖同名静态 `parameters`;使用 `$business.*` 前 Run 必须已绑定业务对象)。
  - `mode: "agent"`:必须提供 `agentId` 和可选 `instruction`;Praxis AssignmentWorker 异步调用 Agent(传入 `runId` / `stepId` / `candidates`),Agent 必须从 `candidates` 中选择并仅返回 `{"assignedTo":"...","reason":"...","evidence":[...]}`,由 AssignmentWorker 将步骤从 `routing` 转为 `waiting`,Agent 不直接调用 `assign`。Agent 定义自身的 `executionUserId` 仍独立控制其工具权限。
  - `actorPolicy.executionPrincipalId`(可选):Praxis 执行 MetricView / Agent 派单请求时使用的主体(用户 ID 或 `loginCode`),留空则使用部署配置 `ONTOPRAXIS_SYSTEM_PRINCIPAL`;它不是最终被选中的办理人。
- **`caseScoped=true` 执行边界(核心安全口径)**:
  - 凡使用 `actorPolicy.mode=rule|agent` 或要求把 `assignedTo` 当作执行权限边界的步骤,**必须配置 `caseScoped: true`**。
  - 激活时**不会**写入角色级 `role × action` 全局授权,Action 只能携带 Praxis 为当前 Run 与当前承办主体签发的 Case 执行凭证调用,防止同角色其他成员绕过 `assignedTo` 直接执行 Action。
  - 若某 Action 仅出现在 ACTIVE 版本的 `caseScoped` 步骤中,普通 `/action/execute` 不会回退到平台级 Action 权限,直接调用应返回未授权——**严禁通过补角色级授权来“绕过”该拦截**。
  - **候选角色映射注意**:当前 Praxis 的 `roleCode → roleId` 候选人解析读取 in-force `/workflow/grants`;因 `caseScoped` 步骤本身不写角色授权行,当 `caseScoped=true` 且 `actorPolicy.mode=rule|agent` 时,同一角色需至少还有一条 in-force 普通授权才能解析出候选主体(`verify` 会专项检查此项)。
- **`inputBindings` 与 `locked`**:`inputBindings` 从 Case `payload` 映射值写入 Action 参数;`locked` 列出的字段始终以 Case 为准,调用方不可覆盖。Run 仅在临时流程或至少含一个 `caseScoped` 步骤时自动创建 Case。
- **`invocationMode`**:当前唯一可执行模式为 `manual`;`automatic` 虽可保存编译,但人工步骤运行时会明确拒绝,固定步骤会忽略该字段。

### 5.4 保存草稿、激活、失效与删除

```bash
node <this-skill>/scripts/client.mjs wf-save @workflow.json
node <this-skill>/scripts/client.mjs wf-query <workflowId>
node <this-skill>/scripts/client.mjs wf-activate <workflowId>
node <this-skill>/scripts/client.mjs wf-deactivate <workflowId>   # 回收该版本授权,保留定义与记录
node <this-skill>/scripts/client.mjs wf-delete <workflowId>       # 仅草稿/已失效流程可删
```

- `wf-save` 保存为 `DRAFT`,**不授予任何权限**;只有 `wf-activate` 才冻结新版本号、落授权、追加 `Activated` 事件并生成待办/详情 MetricView。
- **严禁忽略 `activationNotes`**:为空表示两个查询均已生成;非空说明生成失败或受限,必须排查处理。
- 重复激活未改动的步骤会递增版本号并重发授权,不要将其当作重试手段。更新定义应修改草稿后重新激活;生效中的流程不可直接删除,必须先 `wf-deactivate`。

### 5.5 Case 型临时流程

无独立业务事实类的临时协作流程,由 Praxis 的 `workflow_case` 承载流转数据:

```json
{
  "name": "TMP-虚机申请",
  "temporary": true,
  "runClassName": "workflow_case",
  "caseFormSchema": {
    "type": "object",
    "required": ["cpu", "memory_mb", "disk_mb", "os"],
    "properties": {
      "cpu": {"type": "integer", "minimum": 1},
      "memory_mb": {"type": "integer", "minimum": 1024},
      "disk_mb": {"type": "integer", "minimum": 10240},
      "os": {"type": "string", "enum": ["centos", "ubuntu", "redhat"]},
      "host": {"type": "string", "minLength": 1},
      "ip": {"type": "string", "minLength": 1}
    }
  },
  "steps": [
    {"stepNo": 1, "name": "提交", "roleCode": "研发人员", "actionId": "act_expense_submit", "actionType": "execute", "caseScoped": true},
    {"stepNo": 2, "name": "办理", "roleCode": "研发人员", "actionId": "act_vm_create", "actionType": "execute", "caseScoped": true,
     "inputBindings": {"cpu": "payload.cpu", "memory_mb": "payload.memory_mb", "disk_mb": "payload.disk_mb", "os": "payload.os"},
     "locked": ["cpu", "memory_mb", "disk_mb", "os"]}
  ]
}
```

- `temporary: true` + `runClassName: "workflow_case"` 跳过业务事实类与 `runContract` 校验。
- `caseScoped: true` 不落角色级全局授权,`wf-grants` 中看不到这些步骤属于正常现象。
- `caseFormSchema` 仅支持 `type` / `required` / `enum` / `const` / `minimum` / `maximum` / `minLength` / `maxLength`。
- 验收时 `verify <workflowId>` 允许 `temporary=true` 替代 `runContract`;再由使用方按 `ontoplato-workflow-operator` 跑 `case-submit` / `case-fill` 验证校验与参数锁定。清理时先 `case-close`,再 `wf-deactivate` + `wf-delete`(已冻结 Run 与 Case 保留在 Praxis 账本)。

---

## 6. 配置任务触发(Trigger)

任务触发支持按间隔、每日、每周、每月或 Cron 定时执行已发布动作、启动流程,或运行应用提供的智能体、运维巡检与知识治理。先通过 `trigger-targets` 获取当前域可用目标 ID:

```bash
node <this-skill>/scripts/client.mjs trigger-targets
node <this-skill>/scripts/client.mjs trigger-create '{
  "title":"每天九点发起巡检",
  "targetKind":"workflow",
  "targetId":"<workflowId>",
  "content":{"inputs":{}},
  "frequency":{"kind":"daily","time":"09:00"},
  "timeZone":"Asia/Shanghai",
  "notifyEmail":null
}'
node <this-skill>/scripts/client.mjs trigger-get <triggerId>
node <this-skill>/scripts/client.mjs trigger-status <triggerId> PUBLISHED <revision>
node <this-skill>/scripts/client.mjs trigger-run <triggerId>
node <this-skill>/scripts/client.mjs trigger-history <triggerId> [runId]
```

- `trigger-create` 默认保存待审,加 `--publish` 可直接发布启用;作者以自己身份调用本人有权目标时可直接发布,指定他人作为 `executorId` 发布需管理更改权限。
- 仅已发布、启用且未被系统暂停的定义会按时执行;到点以 `executorId`(缺省为创建人)执行,手动 `trigger-run` 按操作者自身身份执行。
- 修改定义用 `trigger-update <triggerId> <json>`(携带最新 `revision`);删除用 `trigger-delete <triggerId> <revision>`。启动流程后的审批与执行进度按记录里的流程运行编号到 Praxis 查看。

---

## 7. 验收(必须完成)

### 7.1 静态验收

```bash
node <this-skill>/scripts/client.mjs verify <workflowId>
```

检查项包括:`status=ACTIVE`、`version>=1`、`activationNotes` 为空、`runContract` 或 `temporary=true` 已声明、每步 `roleCode` 在域内存在且有成员、`actionId` 非空、`invocationMode=manual`、`actorPolicy` 完整(`rule` 含 `metricViewId/metricRevision`,`agent` 含 `agentId`),以及 `caseScoped=true` 搭配 `rule|agent` 时角色存在用于候选人解析的 in-force 授权。任一项失败必须先修正定义。

### 7.2 动态验收与域开通核对

新域先确认 Praxis 自动开通完成(返回 `ok=true` 后再配双源与动态验收;404 时等待重试并排查日志,不要改环境变量或重启 Praxis):

```bash
node <this-skill>/scripts/client.mjs domain-praxis-check <domainId>
```

再切换至 `ontoplato-workflow-operator` 用各步骤角色真实账号完成动态验证:

1. 发起人执行发起动作并验证返回 `targetClass` 与 `run_id` / `id`;
2. 逐步推进(拉式 `run` 或 Praxis `inbox` → `decide`),核对 `current_node` 与 `status` 变化;
3. **必须覆盖反面用例**:非当前回合重复执行(前置条件拒绝)、无授权人员执行(`notGranted`)、`caseScoped` 步骤同角色非承办人直接执行(未授权)、驳回(状态进入驳回且停止推进);
4. 任务触发用 `trigger-run` + `trigger-history` 验收实际触发记录。

---

## 8. 命令速查

| 命令 | 作用 |
| --- | --- |
| `login / me / me-full / ping` | 认证检查与环境探活 |
| `domains / domain-create / domain-praxis-check [domainId]` | 域管理(建域须显式传 `adminPassword`)与 Praxis 开通核对 |
| `schema-overview / capability-map` | 本体概览与概念能力图谱 |
| `object-type-* / attribute-* / relationship-*` | 事实层对象类型、属性、关系维护 |
| `knowledge-search` | 查业务知识(写入走 `ontoplato-knowledge-governance`) |
| `metric-* / function-*` | 指标视图与函数维护 |
| `skills / skill-files / skill-import / skill-export / skill-delete` | 域技能包维护 |
| `business-config / datasource-multi / praxis-multisource-save / praxis-multisource-check` | 业务配置与双源账本配置核对 |
| `subjects / users / org-* / member-* / position-* / grant-* / roles / role-* / posts / post-* / management-catalog / data-permission-*` | 治理层快捷入口(完整规范见 `ontoplato-permission`) |
| `actions / action-get / action-save / action-trial / action-reexplain / action-publish / action-retire` | Action 管理与三步闭环(权威规则见 `ontoplato-capability-builder`) |
| `wf-save / wf-query / wf-activate / wf-deactivate / wf-delete / wf-grants / wf-access` | Workflow 编排、激活与授权查看 |
| `trigger-list / trigger-get / trigger-targets / trigger-create / trigger-update / trigger-status / trigger-run / trigger-history / trigger-delete` | 任务触发维护与运行记录 |
| `verify <workflowId>` | 流程静态验收 |

所有写命令均支持 `--dry-run`。管理员客户端不提供 `run`,日常执行请使用 `ontoplato-workflow-operator`。

---

## 9. 关键约束与安全红线

- **不要把真实密码、token 或 API Key 写进技能文件、日志或对话**;一律通过环境变量注入。`datasource-multi` / `praxis-multisource-save` 的 dry-run 会遮蔽常见密码字段,生产回执仍按敏感信息处理。
- 组织、角色、授权与流程均为**真实域数据**:删除、失效或临时赋权验收前须确认,验收后及时恢复。
- `Action` 发布后代码冻结;`Workflow` 保存为草稿不授权,激活后生效;生效中流程须先 `wf-deactivate` 才能删除。
- 建域时须在 `domain-create` 中显式传入 `adminPassword`(脚本拉取实例公钥加密传输),平台不再设置固定默认密码。
- `caseScoped` 步骤与 Case 专属 Action 绝不通过补角色级直接授权“放行”;只能在当前 Praxis `waiting` step 由当前承办人通过 `decide` 执行。
- 跨源不能 JOIN;保存 `multiSource` 后须重启数据引擎再验收全部 7 个账本视图。

Files in this skill

  • SKILL.md27.4 KB
  • references/concept-components.md6.7 KB
  • references/praxis-helpers.md4.3 KB
  • references/praxis-multisource.md3.9 KB
  • scripts/client.mjs78.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.