============================
Workflow Stacks Architecture
============================

:Author: Julien Anguenot
:Address: <ja@nuxeo.com>

:Revision: $Id: archi.txt 30344 2005-12-06 13:33:39Z fguillaume $

.. sectnum::    :depth: 4
.. contents::   :depth: 4


Worflow stacks : Delegation / validation features for CPS3.

Details about the implementation.


Data structures
===============

- portal_stack_registry which is referencing the existing stacks
  to be used.

- Data Structure registry to register new stacks within the
  portal_stack_registry.

- The data structures used for the stack by default

  + BaseStack class

  + SimpleStack class

  + HierarchicalStack class

  It's extensible with the portal_stack_registry tool for
  integration.

  Possible to specify rulez about ds management in here :

  + canManage()

  + listLocalRolesMapping()


Stack Definitions
=================

- Holds a given stack configuration.

  + properties (common + specific)

- Holds a data structure instance.

Default Stack Definition Type

- BaseWorkflowStackDefinition

- SimpleWorkflowStackDefinition

- HierarchicalWorkflowStackDefinition

- potal_stack_registry (cf. above)

- Stack Definition registry to register new stack definition

Extensible, with the portal_stack_registry tool for integration.

Possible to add more information on these objects.

State information
=================

- State information related to stacks

  + flags on the states

    * push behavior

    * pop behavion

- State definition holds stack definition declaration.


Transition information
======================

- Transition information related to stacks

  + transition flags

    * push on variables

    * pop on variables

    * returned up hierarchy on variables

    * workflow up on variables

    * workflow down on variables

  N.B.: variable above is a global workflow variable holding a
  stack definition instance.

CPSWorkflow
===========

- CPSWorkflow related

  + _executeTransitions()
        cope transition flags for stacks

  + _checkTransitionGuard()
        Hook for delegatees and local roles check.

  + updateRoleMapping()

CPSWorkflowTool
===============

-  getStackDefinitionsFor(self, ob)

-  getDataStructureStacks(self, ob)

-  getDataStructureStackFor(self, ob, wf_var_id)


CPSWorkflowExpression
=====================

- CPSWorkflowExpression extended DC WF expr
      [? Check if I really need it ?]

Status
======

- The stack data structure is stored within the workflow status,
  **not on the Stack definition.**
