Working with the ezc workflow - vespolina/vespolina-sandbox GitHub Wiki

Home > Proof of Concept

This is an example of how to use the ezc workflow engine . This example is based on "Invoice goods before payment" (described in https://github.com/matubaum/vespolina/wiki/Order-to-Cash-Process-Flow-Diagrams) and consists in 2 parts:

  1. Definition
  2. Execution

#1. Definition Here is where we declarate the structure of the workflow. It can be made with php or xml. In this example we do it with php: https://gist.github.com/782443

Every process step is an instance of ezcWorkflowNodeInput (a node). This kind of node suspends the execution of the workflow, if a given condition is not satisfied like "continue_from_fill_cart". When the workflow is suspended, the user, is supposed to take an action (provide some input information). We are going to see this later, but to know more about it: http://ezcomponents.org/docs/api/latest/Workflow/ezcWorkflowNodeInput.html

Once we have the workflow created, we are able to export it into a graphviz file. The result (with some modifications):

Graph generated https://github.com/matubaum/vespolina/wiki/O2C_invoice_goods_before_payment.workflow.png

#2. Execution

The code: https://gist.github.com/782468

The code pretend to be as simple as possible, and gives an idea of how to implement it. Something to take into consideration, is that is necessary to have a control of many flags like continue_from_fill_cart.

Reference: http://ezcomponents.org/docs/api/latest/classtrees_Workflow.html