2

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

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.