Personal tools
You are here: Home Documentation Tutorials Creating Workflows in Plone Defining Variables
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 Variables

A variable is a piece of information that transcends states. Most variables are persistent. A variable might hold a counter, a flag, the name of the last user who did some action, or any other simple object.

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 4 of 7.

Often a simple flow of states can't model all the details of a business process. For example, in the bill-passing example, a bill might be allowed to be revised and resubmitted once it is vetoed, but only if it has been vetoed once. If it is vetoed a second time, it is killed for good. To model this behavior, the state machine needs to carry a bit of extra information that "remembers" the past veto.

A variable is a piece of information that transcends states. Most variables are persistent. A variable might hold a counter, a flag, the name of the last user who did some action, or any other simple object.

Workflow Variables

Illustration 6: The Standard Workflow Variables in the default Plone workflow


Variables also serve the purpose of exposing metadata to the catalog or the user. There are five variables in the CMF default workflow: actor, action, comments, time, and review_history. The first four are there to keep a record of who executed the last transition, what they did, why, and when. The last variable makes it possible for the user to view the workflow history of an object. (See Illustration 6.)

You can change the value of a variable when executing a transition or when entering a state. Visit a state you created previously then switch to the Variables tab. Here you can reset variables to some specific value. Then visit a transition and switch to the Variables tab. Here you can enter expressions that will be computed to determine the new value of a variable.

 
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