Skip to content

Commit 37b805e

Browse files
authored
Merge pull request #34 from codingapi/dev
update md
2 parents ff30a9c + 2cca1f3 commit 37b805e

10 files changed

Lines changed: 365 additions & 56 deletions

File tree

CLAUDE.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,16 @@ pnpm run dev:app-pc
5959
### Frontend Structure
6060

6161
- **apps/app-pc** - PC client application
62+
- **apps/app-mobile** - Mobile client application (in development)
6263
- **packages/flow-design** - Flow designer component library using @flowgram.ai fixed-layout-editor
64+
- **packages/flow-core** - Core API library with HTTP client and service interfaces
65+
- **packages/flow-types** - TypeScript type definitions for the entire frontend
6366
- `pages/design-panel/types.ts` - TypeScript interfaces for Workflow, FlowNode, FlowForm
6467
- `FlowNode.blocks?: FlowNode[]` - Child nodes for hierarchical structure
6568
- `FlowNode.strategies` - Node strategies configuration
6669
- `FlowNode.actions` - Node actions configuration
6770

68-
Note: `app-mobile`, `flow-pc`, and `flow-mobile` are planned but not yet implemented.
71+
Note: `app-mobile` is currently in development. `flow-pc` and `flow-mobile` packages are planned but not yet implemented.
6972

7073
### Data Structure: Blocks vs Edges
7174

@@ -105,6 +108,8 @@ The workflow engine is organized into 8 layers:
105108

106109
4. **Record Layer** (`com.codingapi.flow.record`)
107110
- `FlowRecord` - Execution record with states (TODO/DONE, RUNNING/FINISH/ERROR/DELETE)
111+
- `FlowTodoRecord` - Todo record for pending tasks
112+
- `FlowTodoMerge` - Todo merge record for aggregation
108113
- Tracks processId, nodeId, currentOperatorId, formData, parallel branch info
109114

110115
5. **Session Layer** (`com.codingapi.flow.session`)
@@ -116,12 +121,13 @@ The workflow engine is organized into 8 layers:
116121
- `OperatorManager` - Manages node operators
117122
- `NodeStrategyManager` - Manages node strategies, provides `loadOperators()`, `generateTitle()`, `verifySession()`, `getTimeoutTime()`, `isDone()`
118123
- `WorkflowStrategyManager` - Manages workflow strategies
124+
- `FlowNodeManager` - Node management functionality
119125
- `FlowNodeState` - Classifies nodes as block nodes or branch nodes for traversal
120126
- `FlowNodeEdgeManager` - Traverses hierarchical node structure via blocks to find next nodes
121127

122128
7. **Strategy Layer** (`com.codingapi.flow.strategy`)
123129
- `INodeStrategy` - Interface with `copy()`, `getId()`, `strategyType()`
124-
- **Node strategies** (14 types): MultiOperatorAuditStrategy, TimeoutStrategy, SameOperatorAuditStrategy, RecordMergeStrategy, ResubmitStrategy, AdviceStrategy, OperatorLoadStrategy, ErrorTriggerStrategy, NodeTitleStrategy, FormFieldPermissionStrategy, DelayStrategy, TriggerStrategy, SubProcessStrategy, RevokeStrategy
130+
- **Node strategies** (16 types): MultiOperatorAuditStrategy, TimeoutStrategy, SameOperatorAuditStrategy, RecordMergeStrategy, ResubmitStrategy, AdviceStrategy, OperatorLoadStrategy, ErrorTriggerStrategy, NodeTitleStrategy, FormFieldPermissionStrategy, DelayStrategy, TriggerStrategy, RouterStrategy, SubProcessStrategy, RevokeStrategy
125131
- **Workflow strategies** (2 types): InterfereStrategy, UrgeStrategy
126132

127133
8. **Script Layer** (`com.codingapi.flow.script.runtime`)
@@ -133,7 +139,7 @@ The workflow engine is organized into 8 layers:
133139
- **Common Interfaces** (`com.codingapi.flow.common`)
134140
- `ICopyAbility` - Interface for copy capability (used by strategies and actions)
135141
- `IMapConvertor` - Interface for Map conversion (used by strategies and actions)
136-
- **Repository Pattern** (`com.codingapi.flow.repository`) - Abstraction for data persistence, isolates framework from implementation. Implementations are in `flow-engine-starter-infra` under `com.codingapi.flow.infra.repository.impl`. Access via `RepositoryHolderContext` singleton. Pattern: Interface in framework, implementation in infra using JPA entities and convertors.
142+
- **Repository Pattern** (`com.codingapi.flow.repository`) - Abstraction for data persistence, isolates framework from implementation. Includes: WorkflowRepository, FlowRecordRepository, WorkflowBackupRepository, ParallelBranchRepository, DelayTaskRepository, UrgeIntervalRepository, FlowTodoRecordRepository, FlowTodoMergeRepository. Implementations are in `flow-engine-starter-infra` under `com.codingapi.flow.infra.repository.impl`. Access via `RepositoryHolderContext` singleton. Pattern: Interface in framework, implementation in infra using JPA entities and convertors.
137143
- **Gateway Pattern** (`com.codingapi.flow.gateway`) - Anti-corruption layer for external system integration (operators, users). Access via `GatewayContext` singleton.
138144
- **Domain Objects** (`com.codingapi.flow.domain`) - DelayTask, DelayTaskManager, UrgeInterval
139145
- **Event System** (`com.codingapi.flow.event`) - 5 event types: FlowRecordStartEvent, FlowRecordTodoEvent, FlowRecordDoneEvent, FlowRecordFinishEvent, FlowRecordUrgeEvent
@@ -156,6 +162,9 @@ When a node is executed, methods are called in this order:
156162
**FlowActionService** (executing an action):
157163
1. Validate request → Validate operator → Get record → Validate state → Load workflow → Get current node → Get action → Build form data → Create session → Verify session → Execute action
158164

165+
**FlowDetailService** (querying workflow details):
166+
1. Fetch workflow details by processId → Include workflow definition, current records, form data
167+
159168
**PassAction.run()** (typical action):
160169
1. Check if node done (StrategyManager) → Update current record → Generate subsequent records → Trigger next nodes → Save records → Push events
161170

Design.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Workflow
306306

307307
#### 策略类型
308308

309-
**节点策略 (14种)**:
309+
**节点策略 (16种)**:
310310

311311
| 策略类 | 说明 |
312312
|-------|------|
@@ -322,6 +322,7 @@ Workflow
322322
| FormFieldPermissionStrategy | 表单字段权限策略 |
323323
| DelayStrategy | 延迟策略 |
324324
| TriggerStrategy | 触发策略 |
325+
| RouterStrategy | 路由策略 |
325326
| SubProcessStrategy | 子流程策略 |
326327
| RevokeStrategy | 撤回策略(REVOKE_NEXT撤回下级/REVOKE_CURRENT撤回到当前节点) |
327328

PRD.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,16 @@ Flow Engine 是一个企业级流程引擎,支持可视化流程设计、动
176176
### 3.1 扩展能力
177177

178178
- **自定义脚本**: 支持 Groovy 脚本扩展
179-
- 发起人匹配脚本
180-
- 审批人加载脚本
181-
- 节点标题脚本
182-
- 条件判断脚本
183-
- 异常触发脚本
184-
- 拒绝动作脚本
179+
- 发起人匹配脚本 (OperatorMatchScript)
180+
- 审批人加载脚本 (OperatorLoadScript)
181+
- 节点标题脚本 (NodeTitleScript)
182+
- 条件判断脚本 (ConditionScript)
183+
- 路由节点脚本 (RouterNodeScript)
184+
- 子流程脚本 (SubProcessScript)
185+
- 触发器脚本 (TriggerScript)
186+
- 异常触发脚本 (ErrorTriggerScript)
187+
- 拒绝动作脚本 (RejectActionScript)
188+
- 自定义动作脚本 (CustomScript)
185189

186190
- **自定义节点**: 支持扩展新的节点类型
187191

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ flow-engine
8989
│ │ ├── ActionManager # 动作管理器
9090
│ │ ├── NodeStrategyManager # 节点策略管理器
9191
│ │ ├── OperatorManager # 操作者管理器
92+
│ │ ├── FlowNodeManager # 节点管理器
93+
│ │ ├── FlowNodeState # 节点状态分类
9294
│ │ └── WorkflowStrategyManager # 工作流策略管理器
9395
│ ├── node # 节点层
9496
│ │ ├── nodes # 节点实现(15种)
@@ -111,6 +113,7 @@ flow-engine
111113
│ │ ├── helper # 节点助手
112114
│ │ │ ├── BackNodeHelper # 退回节点助手
113115
│ │ │ └── ParallelNodeRelationHelper # 并行关系助手
116+
│ │ ├── IBlockNode # 块节点接口
114117
│ │ ├── BaseFlowNode # 节点抽象基类
115118
│ │ ├── BaseAuditNode # 审批节点抽象基类
116119
│ │ ├── IFlowNode # 节点接口
@@ -119,20 +122,27 @@ flow-engine
119122
│ │ └── IFlowOperator # 操作者接口
120123
│ ├── pojo # 数据对象
121124
│ │ ├── body # FlowAdviceBody 请求体
122-
│ │ └── request # 请求对象
123-
│ │ ├── FlowActionRequest # 动作请求
124-
│ │ ├── FlowCreateRequest # 创建请求
125-
│ │ ├── FlowRevokeRequest # 撤回请求
126-
│ │ └── FlowUrgeRequest # 催办请求
125+
│ │ ├── request # 请求对象
126+
│ │ │ ├── FlowActionRequest # 动作请求
127+
│ │ │ ├── FlowCreateRequest # 创建请求
128+
│ │ │ ├── FlowRevokeRequest # 撤回请求
129+
│ │ │ └── FlowUrgeRequest # 催办请求
130+
│ │ └── response # 响应对象
131+
│ │ ├── FlowOperator # 流程操作者
132+
│ │ └── FlowContent # 流程内容
127133
│ ├── record # 流程记录
128-
│ │ └── FlowRecord # 执行记录(TODO/DONE状态)
134+
│ │ ├── FlowRecord # 执行记录(TODO/DONE状态)
135+
│ │ ├── FlowTodoRecord # 待办记录
136+
│ │ └── FlowTodoMerge # 待办合并记录
129137
│ ├── repository # 仓储接口(持久化抽象)
130138
│ │ ├── WorkflowRepository
131139
│ │ ├── FlowRecordRepository
132140
│ │ ├── WorkflowBackupRepository
133141
│ │ ├── ParallelBranchRepository
134142
│ │ ├── DelayTaskRepository
135-
│ │ └── UrgeIntervalRepository
143+
│ │ ├── UrgeIntervalRepository
144+
│ │ ├── FlowTodoRecordRepository
145+
│ │ └── FlowTodoMergeRepository
136146
│ ├── script # 脚本系统
137147
│ │ ├── node # 节点脚本(8种)
138148
│ │ │ ├── OperatorMatchScript # 发起人匹配脚本
@@ -156,12 +166,13 @@ flow-engine
156166
│ │ │ ├── FlowActionService # 流程动作服务
157167
│ │ │ ├── FlowDelayTriggerService # 延迟触发服务
158168
│ │ │ ├── FlowRevokeService # 流程撤回服务
159-
│ │ │ └── FlowUrgeService # 流程催办服务
169+
│ │ │ ├── FlowUrgeService # 流程催办服务
170+
│ │ │ └── FlowDetailService # 流程详情服务
160171
│ │ └── FlowService # 服务接口
161172
│ ├── session # 会话层
162173
│ │ ├── FlowSession # 执行上下文
163174
│ │ └── FlowAdvice # 审批参数(意见、签名、退回节点等)
164-
│ ├── strategy # 策略层(16种:14种节点策略 + 2种工作流策略)
175+
│ ├── strategy # 策略层(18种:16种节点策略 + 2种工作流策略)
165176
│ │ ├── node # 节点策略
166177
│ │ │ ├── MultiOperatorAuditStrategy # 多人审批策略
167178
│ │ │ ├── TimeoutStrategy # 超时策略
@@ -175,6 +186,7 @@ flow-engine
175186
│ │ │ ├── FormFieldPermissionStrategy # 字段权限策略
176187
│ │ │ ├── DelayStrategy # 延迟策略
177188
│ │ │ ├── TriggerStrategy # 触发策略
189+
│ │ │ ├── RouterStrategy # 路由策略
178190
│ │ │ ├── SubProcessStrategy # 子流程策略
179191
│ │ │ ├── RevokeStrategy # 撤回策略
180192
│ │ │ ├── NodeStrategyFactory # 节点策略工厂
@@ -198,9 +210,12 @@ flow-engine
198210
├── flow-engine-example # 示例项目
199211
└── frontend # 前端项目
200212
├── apps
201-
│ └── app-pc # PC端应用
213+
│ ├── app-pc # PC端应用
214+
│ └── app-mobile # 移动端应用(开发中)
202215
└── packages
203-
└── flow-design # 流程设计器
216+
├── flow-design # 流程设计器组件库
217+
├── flow-core # 核心 API 库
218+
└── flow-types # TypeScript 类型定义库
204219
```
205220

206221
## 技术栈

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
| FormFieldPermissionStrategy || 表单字段权限策略 |
8484
| DelayStrategy || 延迟策略(支持秒/分钟/小时/天) |
8585
| TriggerStrategy || 触发策略 |
86+
| RouterStrategy || 路由策略 |
8687
| SubProcessStrategy || 子流程策略 |
8788
| RevokeStrategy || 撤回策略(撤回下级/撤回到当前节点) |
8889
| InterfereStrategy || 干预策略(工作流级别) |

frontend/apps/app-mobile/README.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,67 @@
1-
# Rsbuild project
1+
# Flow Engine 移动端应用
2+
3+
Flow Engine 的移动端流程管理应用(开发中)。
4+
5+
## 简介
6+
7+
`app-mobile` 是 Flow Engine 的移动端 Web 应用,将提供简化的移动操作界面。
8+
9+
> **注意**: 此应用目前处于开发阶段,功能尚未完整实现。
10+
11+
### 核心依赖
12+
13+
- `@flow-engine/flow-core` - 核心 API 库
14+
- `@flow-engine/flow-types` - TypeScript 类型定义
15+
- `antd` - Ant Design 组件库(移动端适配)
16+
- `react-router` + `react-router-dom` - 路由管理
217

318
## Setup
419

5-
Install the dependencies:
20+
安装依赖:
621

722
```bash
823
pnpm install
924
```
1025

11-
## Get started
26+
## 开发
1227

13-
Start the dev server, and the app will be available at [http://localhost:3000](http://localhost:3000).
28+
启动开发服务器,应用将在 [http://localhost:3000](http://localhost:3000) 访问。
1429

1530
```bash
1631
pnpm run dev
1732
```
1833

19-
Build the app for production:
34+
## 构建
35+
36+
构建生产版本:
2037

2138
```bash
2239
pnpm run build
2340
```
2441

25-
Preview the production build locally:
42+
预览生产构建:
2643

2744
```bash
2845
pnpm run preview
2946
```
3047

31-
## Learn more
48+
## 计划功能
49+
50+
### 移动端优化
51+
52+
- 响应式设计适配移动设备
53+
- 触摸优化的交互体验
54+
- 简化的流程处理界面
3255

33-
To learn more about Rsbuild, check out the following resources:
56+
### 核心功能
57+
58+
- 待办任务列表
59+
- 流程审批操作
60+
- 流程进度查看
61+
- 消息通知
62+
63+
## Learn more
3464

35-
- [Rsbuild documentation](https://rsbuild.rs) - explore Rsbuild features and APIs.
36-
- [Rsbuild GitHub repository](https://github.com/web-infra-dev/rsbuild) - your feedback and contributions are welcome!
65+
- [Rsbuild documentation](https://rsbuild.rs) - Rsbuild 特性和 API
66+
- [Rspack documentation](https://rspack.rs) - 底层打包工具
67+
- [Flow Engine Docs](https://github.com/codingapi/flow-engine) - 完整文档

frontend/apps/app-pc/README.md

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,77 @@
1-
# Rsbuild project
1+
# Flow Engine PC 端应用
2+
3+
Flow Engine 的 PC 端流程管理应用。
4+
5+
## 简介
6+
7+
`app-pc` 是 Flow Engine 的 PC 端 Web 应用,提供完整的流程管理功能。
8+
9+
### 核心依赖
10+
11+
- `@flow-engine/flow-design` - 流程设计器组件库
12+
- `@flow-engine/flow-core` - 核心 API 库
13+
- `@flow-engine/flow-types` - TypeScript 类型定义
14+
- `antd` - Ant Design 组件库
15+
- `react-router` + `react-router-dom` - 路由管理
216

317
## Setup
418

5-
Install the dependencies:
19+
安装依赖:
620

721
```bash
822
pnpm install
923
```
1024

11-
## Get started
25+
## 开发
1226

13-
Start the dev server, and the app will be available at [http://localhost:3000](http://localhost:3000).
27+
启动开发服务器,应用将在 [http://localhost:3000](http://localhost:3000) 访问。
1428

1529
```bash
1630
pnpm run dev
1731
```
1832

19-
Build the app for production:
33+
## 构建
34+
35+
构建生产版本:
2036

2137
```bash
2238
pnpm run build
2339
```
2440

25-
Preview the production build locally:
41+
预览生产构建:
2642

2743
```bash
2844
pnpm run preview
2945
```
3046

31-
## Learn more
47+
## 核心功能
3248

33-
To learn more about Rsbuild, check out the following resources:
49+
### 流程设计
50+
51+
- 可视化流程设计器
52+
- 15 种节点类型支持
53+
- 节点配置面板
54+
- 表单设计
55+
- 高级设置
56+
57+
### 流程管理
58+
59+
- 流程定义管理
60+
- 流程实例管理
61+
- 待办/已办列表
62+
- 流程历史记录
63+
64+
### 流程操作
65+
66+
- 通过/拒绝审批
67+
- 保存草稿
68+
- 加签/委派
69+
- 退回/转办
70+
- 流程撤回
71+
72+
## Learn more
3473

35-
- [Rsbuild documentation](https://rsbuild.rs) - explore Rsbuild features and APIs.
36-
- [Rsbuild GitHub repository](https://github.com/web-infra-dev/rsbuild) - your feedback and contributions are welcome!
74+
- [Rsbuild documentation](https://rsbuild.rs) - Rsbuild 特性和 API
75+
- [Rspack documentation](https://rspack.rs) - 底层打包工具
76+
- [Flow Engine Docs](https://github.com/codingapi/flow-engine) - 完整文档
77+
- [AGENTS.md](./AGENTS.md) - 开发指南

0 commit comments

Comments
 (0)