April 24th, 2008

Advanced Workflow Configuration for Drupal

The workflow trinity: States, Owners and Rules

Amnesty International has 400+ employees in their London office who work in various capacities from research, to advocacy, to marketing and development of the organization. Their web and press divisions (primary admins of the website) need to create stories and press releases with input from all of these employees. As a result, workflow became a very important part of this project.

Modules used:

Specific Issues

Need for accountability at all steps in the process

The standard workflow module allows for the definition of arbitrary states and logging, however it does not provide any ownership of those states. In a small website with three or four moderators, this is fine. Stories placed in the “review” state will end up in a queue via views/workflow integration, and moderators will pick through them, moving their states as needed. In our case, each node may have a different fact checker, editor, Sr. editor and translation coordinator who will be responsible for pushing it through the process.

Solution:

We wrote a custom module called Workflow_owner (now contributed back to drupal.org in beta). Workflow Owner creates a new fieldset / tab when editing a node which allows the user to assign ownership to each workflow state.

This module also has views integration, so when a user goes to their user page they see a new tab for workflows owned:

In addition, one can set a default owner for each state:



Need for complex notification and workflow modification rules

But this doesn’t solve the problem of notifying owners when they become responsible. Not everyone is tied to their computer refreshing this page, so we had to develop a solution for this. We contacted Fago soon after workflow_ng was released in beta, and we decided to gamble on this excellent, nay inspired module.

Solution:

Workflow-ng is a great way to fire off complex actions and let the user easilly configure their events and parameters, but it lacked support for workflow based events. We added this in the workflow_workflow_ng module and through the use of tokens which we added to workflow and workflow_owner.

The net result is that a user may specify that on a the event “workflow changed”, where the old state is “draft” and the new state is “review”, send an email to the owner of the review state, and include in it a link to the article in question.

See this short screen cast of how the workflow_ng rules are configured (3min):

Note: I apologize for the shoddy editing, it’s my first time with Camtasia, and I’m still getting used to it :) Please comment if it is really unclear.

Then, when we change the workflow state, the event is fired:

Conclusion:

Workflow software will ultimately not enforce publishing procedures in a media organization, however, it is an excellent tool for keeping records of previous activity, and for facilitating communication among staff.

While much of this code is in beta still for the community as the Amnesty implementation is further customized and tested, it would be great to see people try this setup out and start submitting patches / ideas.

Future enhancements could include:

  • More Worfklow-ng conditions
  • Worfklow-ng actions for changing state / owner
  • i18n support for translation workflow

5 Responses to “Advanced Workflow Configuration for Drupal”

  1. Grabbing Hanuman’s Long Tail » Blog Archive » Amnesty International goes Drupal says:

    […] More on our workflow setup […]

  2. Grabbing Hanuman’s Long Tail » Blog Archive » Helpers_user: The user API that never was says:

    […] (for reference, see my last article on workflow configuration in drupal) […]

  3. Devin Johnston says:

    This is really fantastic stuff! I am currently working on a project for a number of different legal academic journals to allow them to publish their research online. Originally, we were looking at Open Journal Systems as a solution to manage the workflow, but I would prefer to go with Drupal as a more robust and flexible content management system. The configuration you describe would be a perfect fit. Are there any plans to port the module to Drupal 6?

  4. Jacob Singh says:

    Hi Devin!

    Thanks for coming and commenting. It’s nice to see people interested in this! I’m sorry it’s not a more exciting tutorial at present, but yeah the technology is great and usable.

    There are plans to port this to Drupal 6, but unless you are starting your project in 4-5 months, I wouldn’t gamble on it (I personally wouldn’t start any large project on D6 for another 6 months).

    The D6 version has a better name (which I suggested to Fago :) )

    It’s called Rules .

    It will be even better and will support D6 actions. I think there will be a clean upgrade, so you could consider starting in D5, but don’t take my word for it…

    Let me know if you have any more questions or would like some help setting up your workflow/workflow-ng config.

    All the best,
    Jacob

  5. Devin Johnston says:

    Hi Jacob,

    It looks like we will be rolling out with Drupal 5 anyway since CCK, Views, et al. are still in progress toward Drupal 6 compatibility. I’m going to start playing around with the Workflow-related parts of the project today and see what I can do.

    Regards,
    Devin

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

How To find me

Telephone: +1 510.277.0891 | Email: jacobsingh at gmail daht calm

Solution Graphics