add workflow framework

This commit is contained in:
jxxghp
2025-02-12 17:49:01 +08:00
parent 943a462c69
commit 827d8f6d84
7 changed files with 36 additions and 1 deletions

24
app/core/workflow.py Normal file
View File

@@ -0,0 +1,24 @@
class WorkFlowManager:
"""
工作流管理器
"""
def __init__(self):
self.workflows = {}
def register(self, workflow):
"""
注册工作流
:param workflow: 工作流对象
:return:
"""
self.workflows[workflow.name] = workflow
def get_workflow(self, name):
"""
获取工作流
:param name: 工作流名称
:return:
"""
return self.workflows.get(name)