API Documentation

Classes

WorkflowDefinition , portal_workflow

Workflow tool interface.

$Id: portal_workflow.py,v 1.11.14.2 2004/04/23 21:11:34 sidnei Exp $


class WorkflowDefinition

The interface expected of workflow definitions objects. Accesses and changes the workflow state of objects.


Methods

notifyCreated(ob):

Invoked by the portal_workflow tool. Notifies this workflow after an object has been created and put in its new place.

doActionFor(ob, action, comment=):

Invoked by the portal_workflow tool. Allows the user to request a workflow action. This method must perform its own security checks.

listObjectActions(info):

Invoked by the portal_workflow tool. Allows this workflow to include actions to be displayed in the actions box. Called only when this workflow is applicable to info.content. Returns the actions to be displayed to the user.

notifyException(ob, action, exc):

Invoked by the portal_workflow tool. Notifies this workflow that an action failed.

getCatalogVariablesFor(ob):

Invoked by the portal_workflow tool. Allows this workflow to make workflow-specific variables available to the catalog, making it possible to implement queues in a simple way. Returns a mapping containing the catalog variables that apply to ob.

isInfoSupported(ob, name):

Invoked by the portal_workflow tool. Returns a true value if the given info name is supported.

updateRoleMappingsFor(ob):

Updates the object permissions according to the current workflow state.

listGlobalActions(info):

Invoked by the portal_workflow tool. Allows this workflow to include actions to be displayed in the actions box. Generally called on every request! Returns the actions to be displayed to the user.

isActionSupported(ob, action):

Invoked by the portal_workflow tool. Returns a true value if the given action name is supported.

notifyBefore(ob, action):

Invoked by the portal_workflow tool. Notifies this workflow of an action before it happens, allowing veto by exception. Unless an exception is thrown, either a notifySuccess() or notifyException() can be expected later on. The action usually corresponds to a method name.

getInfoFor(ob, name, default):

Invoked by the portal_workflow tool. Allows the user to request information provided by the workflow. This method must perform its own security checks.

notifySuccess(ob, action, result):

Invoked by the portal_workflow tool. Notifies this workflow that an action has taken place.


class portal_workflow

This tool accesses and changes the workflow state of content.


id = Must be set to "portal_workflow"

Methods

notifyCreated(ob):

Notifies all applicable workflows after an object has been created and put in its new place.

doActionFor(ob, action, wf_id=None, *args, **kw):

Invoked by user interface code. Allows the user to request a workflow action. The workflow object must perform its own security checks.

getHistoryOf(wf_id, ob):

Invoked by workflow definitions. Returns the history of an object.

getInfoFor(ob, name, default=[], wf_id=None, *args, **kw):

Invoked by user interface code. Allows the user to request information provided by the workflow. The workflow object must perform its own security checks.

getCatalogVariablesFor(ob):

Invoked by portal_catalog. Allows workflows to add variables to the catalog based on workflow status, making it possible to implement queues. Returns a mapping containing the catalog variables that apply to ob.

setStatusOf(wf_id, ob, status):

Invoked by workflow definitions. Appends to the workflow history.

notifyException(ob, action, exc):

Notifies all applicable workflows that an action failed.

getStatusOf(wf_id, ob):

Invoked by workflow definitions. Returns the last element of a history.

notifySuccess(ob, action, result=None):

Notifies all applicable workflows that an action has taken place.

notifyBefore(ob, action):

Notifies all applicable workflows of an action before it happens, allowing veto by exception. Unless an exception is thrown, either a notifySuccess() or notifyException() can be expected later on. The action usually corresponds to a method name.

getActionsFor(ob):

Return a list of action dictionaries for ob, just as though queried via ActionsTool.listFilteredActionsFor.