Stack Definition
Last modified:
05/20/2006 07:46 AM
| Revision: |
stackdefinition.txt 34431 2006-03-14 20:40:20Z atchertchian |
A stack definition is an object stored within a state definition
object implementing an abstraction layer on a stack object
instance.
A stack definition:
- defines high level accessors and mutators on the stack object.
- defines the policy of roles distributions for the stack elements
stored within the stack using managed roles expressions. It
includes as well a specific guard while the stack object doesn't
contain elements yet.
- defines the default policy for editing and viewing stack
elements using guards. (Note that a stack element has its own
guard that may override the default behavior from the stack
definition).
It may be used as well without any roles policy if the purpose of
the stack is not to distribute local roles. (for instance: adding
a stack of tasks hooked on a given state)
If you need to implement a specific behavior, you may register
your own stack definition.
You must implement the IWorkflowStackDefinition interface and
usually you will inherit from the base StackDefinition class in
your child class which is already implementing this interface.
You may use it like this:
>>> from Products.CPSWorkflow.stackregistries import WorkflowStackDefRegistry
>>> from Products.CPSWorkflow.stackdefinition import StackDefinition
>>>
>>> class MyStackDefinition(StackDefinition):
... # Here implementation
... pass
>>>
>>> WorkflowStackDefRegistry.register(MyStackDefinition)
1
Check the API in the doc/api/ sub-folder.
|