一般工作流程-问题/ez 组件工作流程

发布于 2024-09-07 00:49:02 字数 609 浏览 7 评论 0原文

我寻找了一个用 php 编写的工作流引擎,并找到了 ez 组件工作流类(http: //ezcomponents.org/docs/api/latest/introduction_Workflow.html)。使用示例后,我对(一般)工作流程功能的理解存在两个一般问题:

1.)如果我定义了一般工作流程(例如在审阅后发布文章) - 每篇发布的文章实际上已经开始我的一般发布工作流程的新“实例”。这是对的吗?或者,当相同的工作流程用于许多不同的文章/数据集时,我该如何处理?

2.) 基础应用程序如何与工作流组件一起工作?如果在发布过程中必须向必须审阅文章的人发送一封电子邮件 - 用于发送此电子邮件的代码放在哪里?直接在工作流程中(例如在 WorkflowServiceObject 中的执行方法中)发送电子邮件是否是正确的方法?或者电子邮件的发送是否只是放置在应用程序代码中(保存文章或设置文章的状态后),并且工作流的状态必须在发送电子邮件后设置为下一个节点/级别?

感谢您的回答(对我的英语不好感到抱歉;-))!

蒂莫

I looked for a workflow engine written in php and found the ez components workflow-classes (http://ezcomponents.org/docs/api/latest/introduction_Workflow.html). After work with the examples I have two general problems with the understanding of the (general) workflow-functionality:

1.) If I have defined a general workflow (for example for publish an article after a review) – each posted article has actually start a new “instance” of my general publish-workflow. Is this right? Or how does I handle it when the same workflow is used for many different articles/data-sets?

2.) How does the basis-application have to work with the workflow-component? If in the publish-process an email has to send to the person who has to review the article – where has the code placed for sending this email? Is it the right approach to send the email directly in the workflow, for example in the execute-method in a WorkflowServiceObject? Or does the sending of the email just placed in the application-code (after save an article or set the state of an article) and the state of the workflow has to set to the next node/level after sending the email?

Thanks for some answer (and sorry for my bad english ;-))!

Timo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬色的秋千 2024-09-14 00:49:02

我也是 eZc 工作流程的新手,但我想我可以提供帮助,至少我也希望如此。

  1. 在 eZ Components 工作流程中,首先很明显您需要使用 ezcWorkflowDatabaseDefinitionStorage 类将工作流程定义保存到数据库,对于每篇文章,您都必须通过 ezcWorkflowDatabaseExecution 开始执行工作流程,如下所示你说你必须为每篇文章启动一个实例。但是,当您有很多文章时,如何跟踪每个实例呢?
    您有一个工作流正在处理的实体,这里您的实体是您的文章,因此您需要将您的文章链接到您的工作流实例,例如您的文章可以具有工作流实例的 ID。
  2. 当您想要执行诸如发送电子邮件之类的操作时,您需要使用 WorkflowServiceObject,然后当我们想要在工作流程的一个节点中执行某项操作时,我们使用 ezcWorkflowNodeAction 和给它一个基于 ezcWorkflowServiceObject 的类。

还有一件事,我知道这是您问题中的一个示例,但让我说,在用户服务进程中发送电子邮件不是一个好主意,最好将电子邮件放在队列中并有一个 cron 作业来执行按预定流程发送队列中的电子邮件。

I also new in eZc workflow but I think I can help, at least I wish too.

  1. In eZ Components workflow first it is clear you need to save your workflow definition to database using ezcWorkflowDatabaseDefinitionStorage class, for every article you have to start execution of your workflow by ezcWorkflowDatabaseExecution, as you said you have to start an instance for every article. But how to keep track of every instance when you have many articles?
    You have an entity that the workflow is working on, here your entity is your article so you need to link you article to your workflow instance for example your article can have the Id of your workflow instance.
  2. When ever you want to do something like sending email or ... you need to use WorkflowServiceObject then when every we want to do something in one node of workflow we use ezcWorkflowNodeAction and give it a ezcWorkflowServiceObject based class.

Just one other thing, I know was a sample in you question but let me say, It is not a good idea to sending an email with in a user serving process, its better to put the email on a queue and have a cron job to send the emails from the queue in scheduled proccess.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文