Skip to content

Commit 11b35e1

Browse files
committed
fix md
1 parent 0dce1ff commit 11b35e1

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,39 @@ pnpm run dev:app-pc
4949

5050
- **flow-engine-framework** - Core framework with workflow engine, node types, form system, script execution
5151
- **flow-engine-starter** - Spring Boot starter for web applications
52-
- **flow-engine-starter-infra** - Infrastructure persistence layer (implements repository interfaces)
52+
- **flow-engine-starter-infra** - Infrastructure persistence layer with JPA entities, convertors, and repository implementations
53+
- `entity/` - JPA entities (WorkflowEntity, FlowRecordEntity, DelayTaskEntity, etc.)
54+
- `convert/` - Entity-Domain convertors
55+
- `jpa/` - Spring Data JPA repositories
56+
- `repository/impl/` - Repository interface implementations
5357
- **flow-engine-example** - Example application
5458

5559
### Frontend Structure
5660

5761
- **apps/app-pc** - PC client application
58-
- **packages/flow-design** - Flow designer component library
62+
- **packages/flow-design** - Flow designer component library using @flowgram.ai fixed-layout-editor
63+
- `pages/design-panel/types.ts` - TypeScript interfaces for Workflow, FlowNode, FlowForm
64+
- `FlowNode.blocks?: FlowNode[]` - Child nodes for hierarchical structure
65+
- `FlowNode.strategies` - Node strategies configuration
66+
- `FlowNode.actions` - Node actions configuration
5967

6068
Note: `app-mobile`, `flow-pc`, and `flow-mobile` are planned but not yet implemented.
6169

70+
### Data Structure: Blocks vs Edges
71+
72+
**Critical**: This project uses a hierarchical node structure via `blocks`, NOT edge-based connections.
73+
74+
**Backend (Java)**:
75+
- `IFlowNode.blocks()` returns `List<IFlowNode>` - child nodes
76+
- Block nodes: `ConditionNode`, `ParallelNode`, `InclusiveNode` contain branch nodes
77+
- Branch nodes: `ConditionBranchNode`, `ParallelBranchNode`, `InclusiveBranchNode` are children
78+
- `FlowNodeEdgeManager` traverses blocks recursively to find next nodes
79+
80+
**Frontend (TypeScript)**:
81+
- `FlowNode.blocks?: FlowNode[]` - optional child nodes array
82+
- Legacy `FlowEdge` interface exists but is deprecated
83+
- @flowgram.ai fixed-layout-editor handles the visual representation
84+
6285
### Core Layered Architecture
6386

6487
The workflow engine is organized into 8 layers:
@@ -91,8 +114,10 @@ The workflow engine is organized into 8 layers:
91114
6. **Manager Layer** (`com.codingapi.flow.manager`)
92115
- `ActionManager` - Manages node actions, provides `getAction(Class)`, `verifySession()`
93116
- `OperatorManager` - Manages node operators
94-
- `NodeStrategyManager` - Manages node strategies, provides `loadOperators()`, `generateTitle()`, `verifySession()`
117+
- `NodeStrategyManager` - Manages node strategies, provides `loadOperators()`, `generateTitle()`, `verifySession()`, `getTimeoutTime()`, `isDone()`
95118
- `WorkflowStrategyManager` - Manages workflow strategies
119+
- `FlowNodeState` - Classifies nodes as block nodes or branch nodes for traversal
120+
- `FlowNodeEdgeManager` - Traverses hierarchical node structure via blocks to find next nodes
96121

97122
7. **Strategy Layer** (`com.codingapi.flow.strategy`)
98123
- `INodeStrategy` - Interface with `copy()`, `getId()`, `strategyType()`
@@ -108,10 +133,9 @@ The workflow engine is organized into 8 layers:
108133
- **Common Interfaces** (`com.codingapi.flow.common`)
109134
- `ICopyAbility` - Interface for copy capability (used by strategies and actions)
110135
- `IMapConvertor` - Interface for Map conversion (used by strategies and actions)
111-
- **Repository Pattern** (`com.codingapi.flow.repository`) - Abstraction for data persistence, isolates framework from implementation. Implementations are in `flow-engine-starter-infra`. Access via `RepositoryHolderContext` singleton.
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.
112137
- **Gateway Pattern** (`com.codingapi.flow.gateway`) - Anti-corruption layer for external system integration (operators, users). Access via `GatewayContext` singleton.
113138
- **Domain Objects** (`com.codingapi.flow.domain`) - DelayTask, DelayTaskManager, UrgeInterval
114-
- **Node State System** (`com.codingapi.flow.manager`) - FlowNodeState for node classification (block nodes vs branch nodes), FlowNodeEdgeManager for traversing node relationships via blocks
115139
- **Event System** (`com.codingapi.flow.event`) - 5 event types: FlowRecordStartEvent, FlowRecordTodoEvent, FlowRecordDoneEvent, FlowRecordFinishEvent, FlowRecordUrgeEvent
116140
- **Backup System** (`com.codingapi.flow.backup`) - WorkflowBackup for workflow versioning
117141

@@ -245,8 +269,6 @@ All framework exceptions extend `FlowException` (RuntimeException). Exception co
245269
## Documentation References
246270

247271
- **Design.md** (root) - Comprehensive architecture documentation with class design, lifecycle diagrams, design patterns, and key implementation details
248-
- **AGENTS.md** - Detailed coding guidelines and patterns
249-
- **frontend/apps/app-pc/AGENTS.md** - Frontend app development
250-
- **frontend/packages/flow-design/AGENTS.md** - Frontend library development
272+
- **frontend/apps/app-pc/AGENTS.md** - Frontend app development guidelines
251273
- **Rsbuild**: https://rsbuild.rs/llms.txt
252274
- **Rspack**: https://rspack.rs/llms.txt

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ category.subcategory.errorType
352352

353353
- [PRD.md](PRD.md) - 产品需求文档
354354
- [Design.md](Design.md) - 架构设计文档
355-
- [AGENTS.md](AGENTS.md) - 编码规范
356355
- [CLAUDE.md](CLAUDE.md) - Claude Code 指南
357356
- [TODO.md](TODO.md) - 开发进度
358357

0 commit comments

Comments
 (0)