We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
让我在这里给出一些注释,因为我是 django-fsm 和 django-viewflow 的作者,这两个项目可以称为“工作流库”。
工作流程这个词本身有点被高估了。不同类型的库和软件可以称自己为“工作流”,但具有不同的功能。
共同点是工作流将某些流程的步骤连接成一个整体。
一般分类
据我所知,工作流实现方法可以分为以下几类:
像视图、表单和模板,并支持通过常用的 Python 结构(如类继承)进行更好的自定义。动态工作流假设您具有可以适应任何工作流运行时更改的通用接口。
其中,前两个可以被认为是渐进的差异,但其他两个是根本性的。
具体包
这里是我们现在 django、djangopackages 和 awesome-django 项目的简要描述工作流程部分下的列表:
文档中没有提到机器继承支持,但类状态定义使得无需或很少修改核心库即可实现机器继承支持。
这些django状态机库都不支持并行工作流程,这很大程度上限制了它们的应用范围。但有两个可以做到:
django-viewflow - 显式、多用户、并行、静态工作流程,支持并行任务执行、复杂的拆分和连接语义。提供帮助程序与 django 功能和基于类的视图集成,以及不同的后台任务执行查询,以及各种悲观和乐观锁定策略以防止并发更新。
GoFlow往往是显式、多用户、并行、动态工作流程,但它已被作者放弃多年。
我看到了在 django-viewflow 之上实现动态工作流构建功能的方法。一旦完成,它将结束 django 世界中最后一个也是最复杂的工作流实现案例。
希望,如果有人能够阅读到目前为止,现在可以更好地理解工作流术语,并且可以为他们的项目有意识地选择工作流库。
Let me give a few notes here as i'm the author of django-fsm and django-viewflow, two projects that could be called "workflow libraries".
Workflow word itself is a bit overrated. Different kind of libraries and software could call themselves "workflow" but have varying functionality.
The commonality is that a workflow connects the steps of some process into a whole.
General classification
As I see, workflow implementation approaches can be classified as follows:
like views, forms and templates, and support better customization by usual python constructions like class inheritance. Dynamic workflows assume that you have generic interface that can adapt to any workflow runtime changes.
Of these, the first two could be considered gradual differences, but the other two are fundamental.
Specific packages
Here is brief description what we have nowadays in django, djangopackages and awesome-django project list under workflow section:
machine inheritance support is not mentioned in the documentation, but class state definition makes it possible with none or few core library modifications.
None of these django state machine libraries have support for parallel workflows, which limits their scope of application a lot. But there are two that do:
django-viewflow - explicit, multi-user, parallel, static workflow, with support for parallel tasks execution, complex split and join semantic. Provides helpers to integrate with django functional and class based views, and different background task execution queries, and various pessimistic and optimistic lock strategies to prevent concurrent updates.
GoFlow, mentioned in question, tends to be the explicit, multi-user, parallel, dynamic workflow, but it has been forsaken by author for a years.
I see the way to implement dynamic workflow construction functionality on top of django-viewflow. As soon as it is completed, if will close the last and the most sophisticated case for workflow implementation in the django world.
Hope, if anyone was able to read hitherto, now understands the workflow term better, and can do the conscious choice for workflow library for their project.
是的。
Python。
您不需要工作流程产品来自动执行状态转换、许可以及审计日志记录和通知等其他功能。
这样做的项目不多是有原因的。
状态设计模式非常容易实现。
授权规则(“许可”)已经是一流的
Django 的一部分。
日志记录已经是 Python 的一流部分(并且已经
添加到 Django)。使用它进行审计日志记录要么是审计
表或另一个记录器(或两者)。
消息框架(“通知”)已经是 Django 的一部分。
您还需要什么?你已经拥有了这一切。
使用 State 设计模式的类定义以及用于授权和日志记录的装饰器效果非常好,您不需要任何超出现有功能的东西。
阅读此相关问题:在 Python 中实现“规则引擎”
Yes.
Python.
You don't need a workflow product to automate the state transitions, permissioning, and perhaps some extras like audit logging and notifications.
There's a reason why there aren't many projects doing this.
The State design pattern is pretty easy to implement.
The Authorization rules ("permissioning") are already a first-class
part of Django.
Logging is already a first-class part of Python (and has been
added to Django). Using this for audit logging is either an audit
table or another logger (or both).
The message framework ("notifications") is already part of Django.
What more do you need? You already have it all.
Using class definitions for the State design pattern, and decorators for authorization and logging works out so well that you don't need anything above and beyond what you already have.
Read this related question: Implementing a "rules engine" in Python
这很有趣,因为我会同意 S.Lott 的观点,即只使用 Python 作为规则引擎。完成这件事后,我有了完全不同的看法。
如果你想要一个完整的规则引擎,它需要相当多的活动部件。我们构建了一个完整的 Python/Django 规则引擎,您会对需要构建哪些内容才能启动并运行一个出色的规则引擎感到惊讶。我将进一步解释,但首先该网站是 http://nebrios.com。
规则引擎至少应具有:
因此,请尝试 Nebri 或我在下面列出的其他产品,看看它们是否满足您的需求。
这是调试模式
自动生成的表单
示例工作流规则:
所以,不,仅用 Python 构建基于规则、基于事件的工作流引擎并不简单。我们已经做了一年多了!我建议使用诸如
It's funny because I would have agreed with S.Lott about just using Python as is for a rule engine. I have a COMPLETELY different perspective now having done it.
If you want a full rule engine, it needs a quite a few moving parts. We built a full Python/Django rules engine and you would be surprised what needs to be built in to get a great rule engine up and running. I will explain further, but first the website is http://nebrios.com.
A rule engine should atleast have:
So try out Nebri, or the others I list below to see if they meet your needs.
Here's the debug mode
An auto generated form
A sample workflow rule:
So, no, it's not simple to build a rules based, event based workflow engine in Python alone. We have been at it over a year! I would recommend using tools like
我的同事 django-fsm 编写的包似乎有效 - 它是既相当轻量又足够实用。
A package written by an associate of mine, django-fsm, seems to work--it's both fairly lightweight and sufficiently featureful to be useful.
我可以再添加一个库,该库支持工作流组件的动态更改,这与其等效项不同。
看看 django-river
它现在有一个漂亮的管理员,名为 河流管理
I can add one more library which supports on the fly changes on workflow components unlike its equivalents.
Look at django-river
It is now with a pretty admin called River Admin
ActivFlow:一个通用、轻量级且可扩展的工作流引擎,用于复杂业务流程操作的敏捷开发和自动化。
您可以立即建模整个工作流程!
第 1 步:工作流应用注册
第 2 步:活动配置
第 3 步:流程定义
第 4 步:业务规则
ActivFlow: a generic, light-weight and extensible workflow engine for agile development and automation of complex Business Process operations.
You can have an entire workflow modeled in no time!
Step 1: Workflow App Registration
Step 2: Activity Configuration
Step 3: Flow Definition
Step 4: Business Rules
我将 django-goflow 从 django 1.X -python 2.X 迁移到适合 django 2.X - python 3.x,该项目位于 django2-goflow
I migrate the django-goflow from django 1.X -python 2.X to fit for django 2.X - python 3.x, the project is at django2-goflow