[Zope-CMF] Re: [Plone-developers] Re: Pacefull vs Placeless

Maik Röder roeder at berg.net
Sat Oct 9 15:16:15 EDT 2004


Hi Julien!

Julien Anguenot wrote:
> Hi Alex,
> 
> We have the Placeful workflows within CPS3. It's a fairly easy 
> implementation actually.
> 
> http://cvs.nuxeo.org/cgi-bin/viewcvs.cgi/CPS3/CPSCore/CPSWorkflowConfiguration.py?rev=1.10&content-type=text/vnd.viewcvs-markup 
> 
> 
> + a small hook on the getChainsFor() of the workflow tool.
> 
> The code can be backported easily to Plone.
> 
> Maybe it could be interesting to add this within the CMF ?

+1

I agree with Limi that it would be great if we could get placeful
workflows directly in the CMF, so CPS and Plone can use the same 
infrastructure.

In the getChainsFor method of the workflow tool, the CPS acquires a 
placeful ".cps_workflow_configuration" file like this:

(In the following code from CPSCore/CPSWorkflowConfiguration.py (see 
link above), pt is the portal type and getGlobalChainFor is the default 
CMF implementation, which gets called in case there is no
local chain which applies)

# Find placeful workflow configuration object.
wfconf = getattr(container, CPSWorkflowConfig_id, None)
if wfconf is not None:
     # Was it here or did we acquire?
     start_here = hasattr(aq_base(container), CPSWorkflowConfig_id)
     chain = wfconf.getPlacefulChainFor(pt, start_here=start_here)
if chain is not None:
     return chain
# Nothing placeful found.
     return self.getGlobalChainFor(pt)

It is up to the workflow configuration to decide which workflow
chain should be used in this context.

This could be easily integrated in the CMF as Julien points out.
Also, the code for the configuration file itself 
(CPSWorkflowConfiguration.py) and the management interfaces
could be kept in the CMF, but this is not the most important
part. It is just important to look for a common configuration
file and call "getPlacefulChainFor" on that. From this moment
on, CPS and Plone could go into different directions.

In fact, I would propose to work on another kind of configuration
file for Plone, which does not store the mapping of type to workflow
directly as is done for the CPS (Link by Jean-Marc Orliaguet):

http://www.medic.chalmers.se/~jmo/CPS/placeful_workflow_cps.png

IMHO, the disadvantage of this approach is that when you have several
places where you want to have the same mapping, you have to
reproduce the mapping again and again, which can be error
prone.

Our proposed configuration file would let you choose a policy
instead of a whole mapping of content type to workflow chain:

http://plone.org/Members/maikroeder/choose_policy

The list of policies in the placeful workflow tool:

http://plone.org/Members/maikroeder/workflow_policy_mapping

The policy definition in the placeful workflow tool:

http://plone.org/Members/maikroeder/local_workflow_policy_mapping

Of course, CPS style configuration files can still be supported by Plone.

Best regards,

Maik Röder

PS: Here is the link to the PLIP again:
     "Placeful workflow support for Plone"
     http://plone.org/Members/maikroeder/plip.2004-10-06.1420962338










More information about the Zope-CMF mailing list