camunda-python 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {camunda_python-0.1.1 → camunda_python-0.1.2}/PKG-INFO +42 -14
- {camunda_python-0.1.1 → camunda_python-0.1.2}/README.md +41 -13
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda_python.egg-info/PKG-INFO +42 -14
- {camunda_python-0.1.1 → camunda_python-0.1.2}/pyproject.toml +1 -1
- {camunda_python-0.1.1 → camunda_python-0.1.2}/LICENSE +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/app.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/deps.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/errors.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/pagination.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/routers/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/routers/decision.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/routers/deployment.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/routers/history.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/routers/process_definition.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/routers/process_instance.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/routers/task.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/api/schemas.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/common/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/common/clock.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/common/exceptions.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/common/idgen.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/common/timers.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/dmn/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/dmn/engine.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/dmn/feel.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/engine/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/engine/behavior.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/engine/expression.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/engine/process_engine.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/job/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/job/executor.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/model/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/model/bpmn.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/model/dmn.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/model/execution.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/model/job.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/model/task.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/model/variable.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/parser/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/parser/bpmn_parser.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/parser/dmn_parser.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/persistence/__init__.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/persistence/entities.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda/persistence/store.py +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda_python.egg-info/SOURCES.txt +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda_python.egg-info/dependency_links.txt +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda_python.egg-info/requires.txt +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/camunda_python.egg-info/top_level.txt +0 -0
- {camunda_python-0.1.1 → camunda_python-0.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: camunda-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Python3 reimplementation of Camunda 7 BPMN engine (semantic-aligned, Apache-2.0 independent implementation)
|
|
5
5
|
Author: yingwang
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -61,20 +61,46 @@ pip install camunda-python # 核心(BPMN / DMN / 持久化 / JobEx
|
|
|
61
61
|
pip install camunda-python[api] # 可选:REST API(fastapi + uvicorn)
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
最小可运行示例(拷贝即跑,无需任何本地文件;`examples/loan-approval.bpmn` 为本示例的完整版):
|
|
65
65
|
|
|
66
66
|
```python
|
|
67
|
-
from pathlib import Path
|
|
68
67
|
from camunda.parser import parse_bpmn_xml
|
|
69
68
|
from camunda.engine import ProcessEngine
|
|
70
69
|
|
|
71
|
-
xml =
|
|
70
|
+
xml = """<?xml version="1.0" encoding="UTF-8"?>
|
|
71
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
|
72
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
73
|
+
xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
|
|
74
|
+
id="d1" targetNamespace="http://example.com/loan">
|
|
75
|
+
<bpmn:process id="loan-approval" name="贷款审批流程" isExecutable="true">
|
|
76
|
+
<bpmn:startEvent id="start" name="提交申请"/>
|
|
77
|
+
<bpmn:serviceTask id="check-credit" camunda:delegateExpression="${checkCredit}"/>
|
|
78
|
+
<bpmn:exclusiveGateway id="amount-gateway" default="flow-auto-pass"/>
|
|
79
|
+
<bpmn:userTask id="manual-review" name="人工审批"/>
|
|
80
|
+
<bpmn:exclusiveGateway id="decision-gateway" default="flow-reject"/>
|
|
81
|
+
<bpmn:endEvent id="end-approved" name="已批准"/>
|
|
82
|
+
<bpmn:endEvent id="end-rejected" name="已拒绝"/>
|
|
83
|
+
<bpmn:sequenceFlow id="flow-start" sourceRef="start" targetRef="check-credit"/>
|
|
84
|
+
<bpmn:sequenceFlow id="flow-check" sourceRef="check-credit" targetRef="amount-gateway"/>
|
|
85
|
+
<bpmn:sequenceFlow id="flow-manual" sourceRef="amount-gateway" targetRef="manual-review">
|
|
86
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${amount >= 10000}</bpmn:conditionExpression>
|
|
87
|
+
</bpmn:sequenceFlow>
|
|
88
|
+
<bpmn:sequenceFlow id="flow-auto-pass" sourceRef="amount-gateway" targetRef="end-approved"/>
|
|
89
|
+
<bpmn:sequenceFlow id="flow-review" sourceRef="manual-review" targetRef="decision-gateway"/>
|
|
90
|
+
<bpmn:sequenceFlow id="flow-approve" sourceRef="decision-gateway" targetRef="end-approved">
|
|
91
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${approved == true}</bpmn:conditionExpression>
|
|
92
|
+
</bpmn:sequenceFlow>
|
|
93
|
+
<bpmn:sequenceFlow id="flow-reject" sourceRef="decision-gateway" targetRef="end-rejected"/>
|
|
94
|
+
</bpmn:process>
|
|
95
|
+
</bpmn:definitions>"""
|
|
96
|
+
|
|
72
97
|
engine = ProcessEngine()
|
|
73
|
-
engine.
|
|
98
|
+
engine.register_delegate("checkCredit", lambda v: v.update(credit_ok=True)) # serviceTask 实现
|
|
99
|
+
engine.deploy(parse_bpmn_xml(xml))
|
|
74
100
|
|
|
75
|
-
pi = engine.start_process_instance_by_key("loan-approval", {"amount": 20000})
|
|
76
|
-
task = engine.create_task_query(process_instance_id=pi.id)[0]
|
|
77
|
-
engine.complete_task(task.id, {"approved": True})
|
|
101
|
+
pi = engine.start_process_instance_by_key("loan-approval", {"amount": 20000}) # 大额 -> 人工审批
|
|
102
|
+
task = engine.create_task_query(process_instance_id=pi.id)[0] # [人工审批]
|
|
103
|
+
engine.complete_task(task.id, {"approved": True}) # -> COMPLETED
|
|
78
104
|
```
|
|
79
105
|
|
|
80
106
|
启动 REST 服务:
|
|
@@ -88,9 +114,11 @@ uvicorn camunda.api.app:create_app --factory --port 8080
|
|
|
88
114
|
|
|
89
115
|
| 想做什么 | 看哪里 |
|
|
90
116
|
|---|---|
|
|
91
|
-
| 第一次接触,从「5 分钟 hello world」走到「生产部署」 | **[docs/USER_GUIDE.md](docs/USER_GUIDE.md)** |
|
|
92
|
-
| 看引擎设计 / 模块划分 / 与 Camunda 7 的差异 | **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)** |
|
|
93
|
-
| 看每个示例跑什么场景 | **[examples/](examples
|
|
117
|
+
| 第一次接触,从「5 分钟 hello world」走到「生产部署」 | **[docs/USER_GUIDE.md](https://github.com/movingheart/camunda-python/blob/main/docs/USER_GUIDE.md)** |
|
|
118
|
+
| 看引擎设计 / 模块划分 / 与 Camunda 7 的差异 | **[docs/ARCHITECTURE.md](https://github.com/movingheart/camunda-python/blob/main/docs/ARCHITECTURE.md)** |
|
|
119
|
+
| 看每个示例跑什么场景 | **[examples/](https://github.com/movingheart/camunda-python/tree/main/examples)** |
|
|
120
|
+
|
|
121
|
+
> 文档与示例存放在 GitHub 仓库(PyPI 页面不内嵌),点击上方链接或在仓库根目录查看。
|
|
94
122
|
|
|
95
123
|
## 示例
|
|
96
124
|
|
|
@@ -137,10 +165,10 @@ CI 在 GitHub Actions 上跑 Python 3.12 / 3.13,每次 push 触发。
|
|
|
137
165
|
- **持久化策略**:命令边界 delete + insert 全量重写(与 Camunda 7 逐行 update 不同),
|
|
138
166
|
对中小流程足够快,恢复语义更直白。
|
|
139
167
|
|
|
140
|
-
完整差异表见 [docs/ARCHITECTURE.md §设计取舍](docs/ARCHITECTURE.md)。
|
|
168
|
+
完整差异表见 [docs/ARCHITECTURE.md §设计取舍](https://github.com/movingheart/camunda-python/blob/main/docs/ARCHITECTURE.md)。
|
|
141
169
|
|
|
142
170
|
## 许可
|
|
143
171
|
|
|
144
|
-
Apache-2.0。详见 [LICENSE](LICENSE)。
|
|
172
|
+
Apache-2.0。详见 [LICENSE](https://github.com/movingheart/camunda-python/blob/main/LICENSE)。
|
|
145
173
|
|
|
146
|
-
变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
174
|
+
变更记录见 [CHANGELOG.md](https://github.com/movingheart/camunda-python/blob/main/CHANGELOG.md)。
|
|
@@ -30,20 +30,46 @@ pip install camunda-python # 核心(BPMN / DMN / 持久化 / JobEx
|
|
|
30
30
|
pip install camunda-python[api] # 可选:REST API(fastapi + uvicorn)
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
最小可运行示例(拷贝即跑,无需任何本地文件;`examples/loan-approval.bpmn` 为本示例的完整版):
|
|
34
34
|
|
|
35
35
|
```python
|
|
36
|
-
from pathlib import Path
|
|
37
36
|
from camunda.parser import parse_bpmn_xml
|
|
38
37
|
from camunda.engine import ProcessEngine
|
|
39
38
|
|
|
40
|
-
xml =
|
|
39
|
+
xml = """<?xml version="1.0" encoding="UTF-8"?>
|
|
40
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
|
41
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
42
|
+
xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
|
|
43
|
+
id="d1" targetNamespace="http://example.com/loan">
|
|
44
|
+
<bpmn:process id="loan-approval" name="贷款审批流程" isExecutable="true">
|
|
45
|
+
<bpmn:startEvent id="start" name="提交申请"/>
|
|
46
|
+
<bpmn:serviceTask id="check-credit" camunda:delegateExpression="${checkCredit}"/>
|
|
47
|
+
<bpmn:exclusiveGateway id="amount-gateway" default="flow-auto-pass"/>
|
|
48
|
+
<bpmn:userTask id="manual-review" name="人工审批"/>
|
|
49
|
+
<bpmn:exclusiveGateway id="decision-gateway" default="flow-reject"/>
|
|
50
|
+
<bpmn:endEvent id="end-approved" name="已批准"/>
|
|
51
|
+
<bpmn:endEvent id="end-rejected" name="已拒绝"/>
|
|
52
|
+
<bpmn:sequenceFlow id="flow-start" sourceRef="start" targetRef="check-credit"/>
|
|
53
|
+
<bpmn:sequenceFlow id="flow-check" sourceRef="check-credit" targetRef="amount-gateway"/>
|
|
54
|
+
<bpmn:sequenceFlow id="flow-manual" sourceRef="amount-gateway" targetRef="manual-review">
|
|
55
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${amount >= 10000}</bpmn:conditionExpression>
|
|
56
|
+
</bpmn:sequenceFlow>
|
|
57
|
+
<bpmn:sequenceFlow id="flow-auto-pass" sourceRef="amount-gateway" targetRef="end-approved"/>
|
|
58
|
+
<bpmn:sequenceFlow id="flow-review" sourceRef="manual-review" targetRef="decision-gateway"/>
|
|
59
|
+
<bpmn:sequenceFlow id="flow-approve" sourceRef="decision-gateway" targetRef="end-approved">
|
|
60
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${approved == true}</bpmn:conditionExpression>
|
|
61
|
+
</bpmn:sequenceFlow>
|
|
62
|
+
<bpmn:sequenceFlow id="flow-reject" sourceRef="decision-gateway" targetRef="end-rejected"/>
|
|
63
|
+
</bpmn:process>
|
|
64
|
+
</bpmn:definitions>"""
|
|
65
|
+
|
|
41
66
|
engine = ProcessEngine()
|
|
42
|
-
engine.
|
|
67
|
+
engine.register_delegate("checkCredit", lambda v: v.update(credit_ok=True)) # serviceTask 实现
|
|
68
|
+
engine.deploy(parse_bpmn_xml(xml))
|
|
43
69
|
|
|
44
|
-
pi = engine.start_process_instance_by_key("loan-approval", {"amount": 20000})
|
|
45
|
-
task = engine.create_task_query(process_instance_id=pi.id)[0]
|
|
46
|
-
engine.complete_task(task.id, {"approved": True})
|
|
70
|
+
pi = engine.start_process_instance_by_key("loan-approval", {"amount": 20000}) # 大额 -> 人工审批
|
|
71
|
+
task = engine.create_task_query(process_instance_id=pi.id)[0] # [人工审批]
|
|
72
|
+
engine.complete_task(task.id, {"approved": True}) # -> COMPLETED
|
|
47
73
|
```
|
|
48
74
|
|
|
49
75
|
启动 REST 服务:
|
|
@@ -57,9 +83,11 @@ uvicorn camunda.api.app:create_app --factory --port 8080
|
|
|
57
83
|
|
|
58
84
|
| 想做什么 | 看哪里 |
|
|
59
85
|
|---|---|
|
|
60
|
-
| 第一次接触,从「5 分钟 hello world」走到「生产部署」 | **[docs/USER_GUIDE.md](docs/USER_GUIDE.md)** |
|
|
61
|
-
| 看引擎设计 / 模块划分 / 与 Camunda 7 的差异 | **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)** |
|
|
62
|
-
| 看每个示例跑什么场景 | **[examples/](examples
|
|
86
|
+
| 第一次接触,从「5 分钟 hello world」走到「生产部署」 | **[docs/USER_GUIDE.md](https://github.com/movingheart/camunda-python/blob/main/docs/USER_GUIDE.md)** |
|
|
87
|
+
| 看引擎设计 / 模块划分 / 与 Camunda 7 的差异 | **[docs/ARCHITECTURE.md](https://github.com/movingheart/camunda-python/blob/main/docs/ARCHITECTURE.md)** |
|
|
88
|
+
| 看每个示例跑什么场景 | **[examples/](https://github.com/movingheart/camunda-python/tree/main/examples)** |
|
|
89
|
+
|
|
90
|
+
> 文档与示例存放在 GitHub 仓库(PyPI 页面不内嵌),点击上方链接或在仓库根目录查看。
|
|
63
91
|
|
|
64
92
|
## 示例
|
|
65
93
|
|
|
@@ -106,10 +134,10 @@ CI 在 GitHub Actions 上跑 Python 3.12 / 3.13,每次 push 触发。
|
|
|
106
134
|
- **持久化策略**:命令边界 delete + insert 全量重写(与 Camunda 7 逐行 update 不同),
|
|
107
135
|
对中小流程足够快,恢复语义更直白。
|
|
108
136
|
|
|
109
|
-
完整差异表见 [docs/ARCHITECTURE.md §设计取舍](docs/ARCHITECTURE.md)。
|
|
137
|
+
完整差异表见 [docs/ARCHITECTURE.md §设计取舍](https://github.com/movingheart/camunda-python/blob/main/docs/ARCHITECTURE.md)。
|
|
110
138
|
|
|
111
139
|
## 许可
|
|
112
140
|
|
|
113
|
-
Apache-2.0。详见 [LICENSE](LICENSE)。
|
|
141
|
+
Apache-2.0。详见 [LICENSE](https://github.com/movingheart/camunda-python/blob/main/LICENSE)。
|
|
114
142
|
|
|
115
|
-
变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
143
|
+
变更记录见 [CHANGELOG.md](https://github.com/movingheart/camunda-python/blob/main/CHANGELOG.md)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: camunda-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Python3 reimplementation of Camunda 7 BPMN engine (semantic-aligned, Apache-2.0 independent implementation)
|
|
5
5
|
Author: yingwang
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -61,20 +61,46 @@ pip install camunda-python # 核心(BPMN / DMN / 持久化 / JobEx
|
|
|
61
61
|
pip install camunda-python[api] # 可选:REST API(fastapi + uvicorn)
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
最小可运行示例(拷贝即跑,无需任何本地文件;`examples/loan-approval.bpmn` 为本示例的完整版):
|
|
65
65
|
|
|
66
66
|
```python
|
|
67
|
-
from pathlib import Path
|
|
68
67
|
from camunda.parser import parse_bpmn_xml
|
|
69
68
|
from camunda.engine import ProcessEngine
|
|
70
69
|
|
|
71
|
-
xml =
|
|
70
|
+
xml = """<?xml version="1.0" encoding="UTF-8"?>
|
|
71
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
|
72
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
73
|
+
xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
|
|
74
|
+
id="d1" targetNamespace="http://example.com/loan">
|
|
75
|
+
<bpmn:process id="loan-approval" name="贷款审批流程" isExecutable="true">
|
|
76
|
+
<bpmn:startEvent id="start" name="提交申请"/>
|
|
77
|
+
<bpmn:serviceTask id="check-credit" camunda:delegateExpression="${checkCredit}"/>
|
|
78
|
+
<bpmn:exclusiveGateway id="amount-gateway" default="flow-auto-pass"/>
|
|
79
|
+
<bpmn:userTask id="manual-review" name="人工审批"/>
|
|
80
|
+
<bpmn:exclusiveGateway id="decision-gateway" default="flow-reject"/>
|
|
81
|
+
<bpmn:endEvent id="end-approved" name="已批准"/>
|
|
82
|
+
<bpmn:endEvent id="end-rejected" name="已拒绝"/>
|
|
83
|
+
<bpmn:sequenceFlow id="flow-start" sourceRef="start" targetRef="check-credit"/>
|
|
84
|
+
<bpmn:sequenceFlow id="flow-check" sourceRef="check-credit" targetRef="amount-gateway"/>
|
|
85
|
+
<bpmn:sequenceFlow id="flow-manual" sourceRef="amount-gateway" targetRef="manual-review">
|
|
86
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${amount >= 10000}</bpmn:conditionExpression>
|
|
87
|
+
</bpmn:sequenceFlow>
|
|
88
|
+
<bpmn:sequenceFlow id="flow-auto-pass" sourceRef="amount-gateway" targetRef="end-approved"/>
|
|
89
|
+
<bpmn:sequenceFlow id="flow-review" sourceRef="manual-review" targetRef="decision-gateway"/>
|
|
90
|
+
<bpmn:sequenceFlow id="flow-approve" sourceRef="decision-gateway" targetRef="end-approved">
|
|
91
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${approved == true}</bpmn:conditionExpression>
|
|
92
|
+
</bpmn:sequenceFlow>
|
|
93
|
+
<bpmn:sequenceFlow id="flow-reject" sourceRef="decision-gateway" targetRef="end-rejected"/>
|
|
94
|
+
</bpmn:process>
|
|
95
|
+
</bpmn:definitions>"""
|
|
96
|
+
|
|
72
97
|
engine = ProcessEngine()
|
|
73
|
-
engine.
|
|
98
|
+
engine.register_delegate("checkCredit", lambda v: v.update(credit_ok=True)) # serviceTask 实现
|
|
99
|
+
engine.deploy(parse_bpmn_xml(xml))
|
|
74
100
|
|
|
75
|
-
pi = engine.start_process_instance_by_key("loan-approval", {"amount": 20000})
|
|
76
|
-
task = engine.create_task_query(process_instance_id=pi.id)[0]
|
|
77
|
-
engine.complete_task(task.id, {"approved": True})
|
|
101
|
+
pi = engine.start_process_instance_by_key("loan-approval", {"amount": 20000}) # 大额 -> 人工审批
|
|
102
|
+
task = engine.create_task_query(process_instance_id=pi.id)[0] # [人工审批]
|
|
103
|
+
engine.complete_task(task.id, {"approved": True}) # -> COMPLETED
|
|
78
104
|
```
|
|
79
105
|
|
|
80
106
|
启动 REST 服务:
|
|
@@ -88,9 +114,11 @@ uvicorn camunda.api.app:create_app --factory --port 8080
|
|
|
88
114
|
|
|
89
115
|
| 想做什么 | 看哪里 |
|
|
90
116
|
|---|---|
|
|
91
|
-
| 第一次接触,从「5 分钟 hello world」走到「生产部署」 | **[docs/USER_GUIDE.md](docs/USER_GUIDE.md)** |
|
|
92
|
-
| 看引擎设计 / 模块划分 / 与 Camunda 7 的差异 | **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)** |
|
|
93
|
-
| 看每个示例跑什么场景 | **[examples/](examples
|
|
117
|
+
| 第一次接触,从「5 分钟 hello world」走到「生产部署」 | **[docs/USER_GUIDE.md](https://github.com/movingheart/camunda-python/blob/main/docs/USER_GUIDE.md)** |
|
|
118
|
+
| 看引擎设计 / 模块划分 / 与 Camunda 7 的差异 | **[docs/ARCHITECTURE.md](https://github.com/movingheart/camunda-python/blob/main/docs/ARCHITECTURE.md)** |
|
|
119
|
+
| 看每个示例跑什么场景 | **[examples/](https://github.com/movingheart/camunda-python/tree/main/examples)** |
|
|
120
|
+
|
|
121
|
+
> 文档与示例存放在 GitHub 仓库(PyPI 页面不内嵌),点击上方链接或在仓库根目录查看。
|
|
94
122
|
|
|
95
123
|
## 示例
|
|
96
124
|
|
|
@@ -137,10 +165,10 @@ CI 在 GitHub Actions 上跑 Python 3.12 / 3.13,每次 push 触发。
|
|
|
137
165
|
- **持久化策略**:命令边界 delete + insert 全量重写(与 Camunda 7 逐行 update 不同),
|
|
138
166
|
对中小流程足够快,恢复语义更直白。
|
|
139
167
|
|
|
140
|
-
完整差异表见 [docs/ARCHITECTURE.md §设计取舍](docs/ARCHITECTURE.md)。
|
|
168
|
+
完整差异表见 [docs/ARCHITECTURE.md §设计取舍](https://github.com/movingheart/camunda-python/blob/main/docs/ARCHITECTURE.md)。
|
|
141
169
|
|
|
142
170
|
## 许可
|
|
143
171
|
|
|
144
|
-
Apache-2.0。详见 [LICENSE](LICENSE)。
|
|
172
|
+
Apache-2.0。详见 [LICENSE](https://github.com/movingheart/camunda-python/blob/main/LICENSE)。
|
|
145
173
|
|
|
146
|
-
变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
174
|
+
变更记录见 [CHANGELOG.md](https://github.com/movingheart/camunda-python/blob/main/CHANGELOG.md)。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|