Defining Variables
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.

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.
The State variable name
Every workflow has a special variable name for access of the current state. In Plone, this is usually "review_state" -- however, when creating a new workflow definition through the web, it should be noted that the default name of "state" on new workflows is not sufficient for complete workflow functionality in Plone. When creating new workflows, scroll to the bottom of the "Variables" tab in the Zope Management Interface for your workflow definition, and set the workflow's state variable name to review state. Without this change, workflow menus on items will not display.
