Personal tools
You are here: Home Documentation Tutorials Creating Workflows in Plone Defining Worklists and Scripts
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Defining Worklists and Scripts

Worklists add links to users' actions box when there are items in a certain state. Scripts perform actions when users execute specific transitions.

Jon Stahl

This documentation explains the purpose of the DCWorkflow product and how to make use of it. DCWorkflow is a CMF Product for Zope, and Plone's workflows are built using it.
Page 5 of 7.

Defining Worklists

Some users need notification of work that needs to be completed. For example, in the CMF default workflow, users with the Reviewer role need to be told when there are items pending review, so they can visit them and either publish or reject them.


One way to accomplish this is with worklists. Worklists add links to users' actions box when there are items in a certain state. The CMF default workflow supplies one worklist. It shows the Pending Review link to reviewers when there are items they are allowed to review.


After creating a worklist, enter the name of the state it matches. Use a guard condition to make only certain users see it. Also enter the name and URL of the link to be displayed.


Defining Scripts


You may need to perform actions like sending an email or invoking another workflow when users execute specific transitions. You can do this by writing scripts. Scripts can be any Zope object, but Scripts (Python) are most likely the best choice.


Scripts are passed one parameter, the state_change object of a workflow expression. Remember that your script is executed with the permissions of the user who invokes the transition, rather than your own permissions, unless you give the script proxy roles.


Once a script is in the Scripts container of a workflow you can visit a transition and select the script to be executed. The script will be executed before the state change and before variables are updated. It can raise exceptions to veto the action or an ObjectMoved or ObjectDeleted exception to tell the workflow that the object has moved or has been deleted.

 
by Jon Stahl last modified July 2, 2006 - 22:42
Contributors: Shane Hathaway
All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by