[wp-hackers] WorkFlow in WordPress?

Mike Schinkel mikeschinkel at newclarity.net
Thu Jun 25 19:15:31 GMT 2009


Hi Hackers:

I to bring up a discussion about Workflow in WordPress.  But first  
some background:

I have recently been working on a personal project that needs some  
built in workflow so that several processes can be automated related  
to links. I decided the best way to do that was to use a Link Category  
with non-visible links as a workflow queue and use link metadata to  
store the the current workflow state for each link (which is why I  
started this[1] discussion.)

Today Simon Blackbourn emailed the list [2] about the email address  
and name used in notification messages to which Jennifer Hodgdon  
suggested a configurable option, separate from the "admin" user's  
email address and I agree with that.  Of course adding such an option  
would increase the complexity of an install and thus I would expect  
the community would fight against such an option as if its life  
depended on it.

However what I could see working would be to have a notice in the  
admin section that shows up after initial installation that says "You  
haven't set your blog email address yet. Click here to set it now!"   
That way the email address could default to wordpress at mydomain.com,  
not require any additional conceptual load on the user during install,  
and be very simple to update after the user gets past being  
overwhelmed by the initial installation (I'm assuming the least  
technical user possible here. :)

Of course that looks so very similar to a workflow system to me  
especially since I've been thinking about exactly the same for my  
existing project.  And as I write this it occurs to me that WordPress  
could benefit from essentially a checklist of "todo" items that could  
be added as notifications upon initial install. And it also occurs to  
me that many plugins could also benefit from the same, i.e. "You just  
installed me, now go set my options!"

Akismet actually currently does this using the "admin_notices" hook  
and this hook could be used by any plugin to generate the types of  
notices I'm mentioning but doing so needs to be implicitly coupled to  
arbitrary data items, such as the Akismet API key in wp_options. But  
this approach isn't formalized and it's not standardized in any way to  
handle workflow so there are no obvious pattern for developers to  
follow in creating workflow and no "economies of scale" where numerous  
coding could be contributing to the same overall system.

So this makes me think it makes sense to introduce a simple workflow  
system into WordPress, possibly first as a plugin, that would create a  
queue for arbitrary workflows that could be defined and used by other  
plugins.  To see if anyone has come before with these concerts I  
googled and found than an Edward Dale of University of North Carolina  
(cc'd on this email) has done some work [3][4][5] in this area along  
with a plugin called Zensor[6] though I didn't see that anyone else is  
really touching on the subject. Looking at Zensor it seems to address  
workflow related to moderation of post contributors and not generic  
workflow in general.

What I have in mind was a generic workflow system, something that  
could handle the Zensor use cases but also a while lot more. Something  
like adding a wp_workflow table to contain a list of in-process  
workflows with fields for id (int), name (varchar), type (varchar),  
state/status (varchar), meta (text, for serialized array) and probably  
a few other fields I haven't thought of yet.  The code would include  
some schedule tasks that process the workflow queue periodically and  
then call hooks to process the workflow queue and move each workflow  
items from state to state as appropriate. It would also include  
various helper functions to streamline the process of using the  
workflow system. By itself this plugin/functionality would do very  
little for end users; it would only be something that other plugins or  
even core could use to implement workflows.

I'm emailing to get your thoughts on this. I'm thinking seriously of  
implementing this since I pretty much need it for my own use but I'd  
like to know what others think about it, if others have previously  
spent any time thinking about this, if others may even already have  
code for it, and if others here think this is something that could  
make it's way into core.

So, thoughts?

-Mike Schinkel
WordPress Custom Plugins
http://mikeschinkel.com/custom-wordpress-plugins/

[1] http://comox.textdrive.com/pipermail/wp-hackers/2009-June/026584.html 
  (Link Metadata)
[2] http://comox.textdrive.com/pipermail/wp-hackers/2009-June/026706.html 
  (Address and name used in notification messages)
[3] http://comox.textdrive.com/pipermail/wp-hackers/2009-March/025470.html 
  (GSoC2009 idea: Workflows/Moderation in WordPress)
[4] http://codex.wordpress.org/User:Scompt/Workflow_With_WordPress
[5] http://scompt.com/archives/2009/03/29/wordpress-gsoc-2009-idea-workflow
[6] http://wordpress.org/extend/plugins/zensor/



More information about the wp-hackers mailing list