ReactiveWorkflow

by Laurence Rowe last modified Feb 16, 2011 02:09 AM

Enable the workflows in a portal type's chain to interact by triggering each other's automatic transitions. This allows for the construction of complex and modular workflows with parallel execution paths that split and join.

Project Description

==================
 ReactiveWorkflow
==================

Enable the workflows in a portal type's chain to interact by triggering each
other's automatic transitions. This allows for the construction of complex and
modular workflows with parallel execution paths that split and join.

Add a subscriber for your type:

    <subscriber
        for=".my.ContentType
             Products.CMFCore.interfaces.IActionSucceededEvent"
        handler="Products.ReactiveWorkflow.subscriber.trigger_automatic_transitions"
        />

In portal_workflow give your type a comma separated list of workflows, e.g:

  my_workflow, sub_workflow, another_sub_workflow

Construct your sub-workflows so that they start off in a paused state, with an
automatic transition to a started state, guarded by a check on the 'parent'
workflow review state. e.g.:

    python:here.portal_workflow.getInfoFor(here, 'review_state', wf_id='my_workflow') == 'pending'

The parent workflow can then have an automatic or user transition with a guard
checking that the sub workflows have reached a certain state. e.g.:

    python:not [False for wf_id in ['sub_workflow', 'another_sub_workflow'] if here.portal_workflow.getInfoFor(here, 'review_state', wf_id=wf_id) != 'completed']


Notes
-----

I've included a monkey patch to DCWorkflow that prevents automatic transition
from being executed without checking their guards when the "'Manager' role
bypasses guards" option is set.


Licence: Zope Public Licence 2.1

Laurence Rowe  -  #plone/elro  -  http://objectvibe.net/blog

Current Release

No stable release available yet.

If you are interested in getting the source code of this project, you can get it from the Code repository .

All Releases

Version Released Description Compatibility Licenses Status

Comments (0)