Share » Learn » eZ Publish » Creating a simple custom workflow event

Creating a simple custom workflow event

Thursday 09 December 2010 8:01:18 am

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Step 2 (continued) - Setting up a default workflow for content approval

We have now setup a workflow “Before publishing” that is running another workflow “Content approval” using a multiplexer event. This execution will occur only on “Comments” items being published.

Is that it? No! A workflow won’t be executed if you don’t attach it to a workflow trigger. So lets configure one, click on “Triggers” from the left hand side menu:

Plugging-in the eZ Publish workflow on a trigger

 

Fig. 6 shows you the list of triggers available in eZ Publish. Adding a new trigger is out of the scope of this tutorial. What we are interested in this screen is the two triggers from the “content” module (the two first ones). As you can guess, the first one is a trigger that would execute a workflow before the publish process of a content. In the “Workflow” column, select our workflow group “Before publishing” for the ”content / publish / before” trigger, then click on “Apply changes”.

Now, we’re done.

Every time a content will be published in eZ Publish, the CMS will trigger the “Before Publishing” workflow before publishing the actual content (so the content is still a draft). In turn, the “Before Publishing” workflow is using a multiplexer that will check few rules before executing the other workflow “Content Approval” that is actually executing the content approval process by running the “Event / Approve” event.

From now on, if a user add a comment, it will be sent out pending for approval. The approvers will find a list of pending items by logging in the admin interface and click on the “Collaboration” link on the Dashboard (for eZ Publish versions prior to 4.3, the “Collaboration” area is found under “My account” from the top menu.

We will not go into details on this “Collaboration” tool, but here’s how it looks like in Fig. 7:

Approval collaboration interface - eZ Publish Workflows