Forums / Discussions / Creating a simple custom workflow event

Thursday 09 December 2010 8:01:18 am - 6 replies

» Read full tutorial

Introduction

This tutorial will guide you through the development of a simple eZ Publish workflow event. At the end of the tutorial, you should be able to create your own workflow event, configure a workflow that would execute the event and configure workflow triggers in the admin interface.

Note : the PDF version of this tutorial, as well as the downloadable extension are here.

 
Author Message

Robin Muilwijk

Saturday 11 December 2010 12:27:38 am

Hi,

Great tutorial! A very good addition to the online docs, I'm sure this will inspire others when setting up their workflows. It also shows the power of eZ Publish, thanks for this contribution!

-- Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Kristof Coomans

Saturday 11 December 2010 9:34:58 am

There seems to be a small typo on Step 8:

"

It’s not time to see how to retrieve them.

"

I guess "not" should have been "now".

Nice tutorial, posting Twitter updates is a perfect use case for workflows!

However, the used process of authorizing eZ Publish to have access to the twitter account looks quite cumbersome to me. I guess it could be made a lot easier by offering a screen for that in the eZ Publish administration interface that starts the full web-based authorization process instead of the out-of-band/PIN code authentication which was not really suitable for this kind of app. A good example of how this is done is the nxc_twitter extension available at http://projects.ez.no/nxc_twitter.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Romeo Antony

Sunday 12 December 2010 12:29:49 am

Huy,

Good tutorial. Learned a lot from this like how to integrate 3rd party libraries, creating custom wrokflowevents.

Maxime Thomas

Monday 13 December 2010 4:46:56 am

Hi,

Excellent article which shows the power of workflows and how thing can be easily done with it.

However, I just regret you don't put some examples on how debug thoses workflows, it can be tricky for some people.

Max

maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Nicolas Pastorino

Wednesday 15 December 2010 4:46:39 am

"

There seems to be a small typo on Step 8:

"

It’s not time to see how to retrieve them.

"

I guess "not" should have been "now".

"

Thanks, fixed now.

"

Nice tutorial, posting Twitter updates is a perfect use case for workflows!

However, the used process of authorizing eZ Publish to have access to the twitter account looks quite cumbersome to me. I guess it could be made a lot easier by offering a screen for that in the eZ Publish administration interface that starts the full web-based authorization process instead of the out-of-band/PIN code authentication which was not really suitable for this kind of app. A good example of how this is done is the nxc_twitter extension available at http://projects.ez.no/nxc_twitter.

"

I agree here, although it is not exactly the scope of this already thorough tutorial. It could be a follow-up tutorial, showing how to create custom panels and tabs in the admin interface ? Easy, yet very useful.

Cheers Kristof,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Quoc Huy Nguyen Dinh

Wednesday 15 December 2010 4:50:29 am

Thank you all for the feedbacks. Very much appreciate it.

@Kristof, I've notified Nicolas to see if the typo can be corrected. Regarding the Twitter API you are correct, this is not the easiest way to handle this and NXC technique is sweet. But this allows one to also discover eZ Script.

@maxime, I usually debug my workflows with eZLog::write() which is used here.

You must be logged in to post messages in this topic!

eZ debug

Timing: Jan 17 2025 18:01:57
Script start
Timing: Jan 17 2025 18:01:57
Module start 'content'
Timing: Jan 17 2025 18:01:58
Module end 'content'
Timing: Jan 17 2025 18:01:58
Script end

Main resources:

Total runtime0.4451 sec
Peak memory usage4,096.0000 KB
Database Queries226

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 596.1641180.8359
Module start 'content' 0.00840.2399 777.00001,018.1719
Module end 'content' 0.24830.1968 1,795.1719348.0703
Script end 0.4450  2,143.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.01202.7031210.0006
Check MTime0.00150.3338210.0001
Mysql Total
Database connection0.00130.302410.0013
Mysqli_queries0.305668.66362260.0014
Looping result0.00270.60502240.0000
Template Total0.400890.020.2004
Template load0.01012.260120.0050
Template processing0.390787.774120.1954
Template load and register function0.00020.043410.0002
states
state_id_array0.00300.667920.0015
state_identifier_array0.00240.538330.0008
Override
Cache load0.00982.2106540.0002
Sytem overhead
Fetch class attribute name0.00140.3163130.0001
Fetch class attribute can translate value0.00140.325470.0002
class_abstraction
Instantiating content class attribute0.00000.0046130.0000
XML
Image XML parsing0.00370.821370.0005
General
dbfile0.00771.7196610.0001
String conversion0.00000.001330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplforum_topic/full.tplextension/community_design/design/suncana/override/templates/forum_topic/full.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1content/datatype/view/ezxmltags/separator.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltags/separator.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 36
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs