CPS3 > Z3ECM From stateful to activity based worflow
Julien Anguenot <ja@nuxeo.com>
27 Juin 2005
NO to software patents in EU!
Who am I ?
Python and Zope developer since 1999 CMF / Zope3 contributor Core CPS Platform developer Core Z3/ECM developer R&D engineer at Nuxeo (Paris, France)
3
OUTLINE
Introduction
what / why / when ? concepts workflow stack architecture hybrid workflow model status WFMC / XPDL / Zope3 architecture draft status
4
CPSWorkflow
The future > Z3 / ECM workfow
Summary
Workflow / processes ?
Modelisation of a business application (real life use case) Defines flows and entities following them. Control the actions peformed on the flows by the entities Workflow engine types
Stateful workflows (object / document centric) Activity based workflow (i.e : WFMC specifications) ECM app ERP app
5
Can / should be used for :
CPSWorkflow concepts (1/3)
DCWorkflow concepts (1/2)
Deterministic finite-state automata Workflow definition applied on content type (generic) States
Permissions / roles maps Guards (permissions, roles, TALES (ns)) Before / after scripts Update the objects security Defined globally on the workflow definition Defined on a given state Same semantic
Transitions
Variables
6
CPSWorkflow concepts (2/3)
DCWorkflow concepts (2/2)
Global history (on the object) Workflow tool (CMF) Python scripts Business logic implementation
DCWorkflow limits
Scripting sucks (yes it does ;)) containement triggering actions on a set of objects where different workflows are involved
Object relations
Static permissions / roles maps
7
Advantage : simple and works.
CPSWorkflow concepts (3/3)
CPSWorkflow extends DCWorkflow for :
Business logic Placefulness Dynamic local roles management Security checks and containement Global history (because of versionning and publication) CPS core tied integration
proxy / repository knowledge versionning knowledge publication l10n
8
CPS3 is a workflow driven framework by design
Business logic : transition flags
Logic executed when the transition is fired. (business logic) Hooks on _executeTransition() Subobject behaviors
create, delete, publish, checkout, move, copy Create, publish, checkout, checkin
Initial transitions for
Freeze Delete Merge (publication case) Action with initial transition at destination
publish, checkout, checkin,
9
Placeful workflows chains
For a given subtree, a given portal_type is going to follow a given workflow Example : subtree workspaces with specific workflows and subtree for the sections CPSWorkflowConfiguration object through ZMI (.cps_workflow_configuration) When defined in a folder it applies to the folder itself and all the sub-folders recursively You may apply a restriction on the folder itself ('Below workflow chains')
10
Global history
Documents are in several locations in several versions Can't be stored within the proxy (may be destroyed) Workflow tool: getFullHistoryOf() Actually stored within the repository tool
11
Workflow stack framework
What is it for at first ?
Distribute roles to users / groups dynamically according to a policy controled by the workflow. Typical use cases :
Dynamic validation (chain) Dynamic delegation (chain)
In real life :
Organization's incoming / outgoing mails management. Civil state management Archives management and consultation etc...
12
Stack
data structure holding stack element instances
users / groups / tasks / whatever object
« Smart » high level workflow variable _prepareElements() constructing stack elements instances before storing them. Control r/w access according getStackContent() render() method to ease integration Implements the IWorkflowStack interface Stack type registry Basic stack types
Simple stack type
13
Stack element
Type of object instances stored within a stack. Implements IWorkflowStackElement prefix / meta_type / hidden_meta_type Guards
view_guard : isVisible(sm, stack, context) edit_guard : isEditable(sm, stack, context)
Stack element registry Basic stack elements
(Hidden) (Hidden) (Hidden) (Hidden)
User Stack Element Group Stack Element User Substitute Stack Element Group Substitute Stack Element
14
Stack Definition (1/3)
Abstraction for the stack providing :
high level accessors and mutators on the stack the policy of roles distributions for the stack elements defined within the stack using this stack definition defines the default policy for editing stack elements and special guards for empty stacks behavior.
Defined on a state. Several different stack definitions can be defined on a state
15
Stack definition (2/3)
Properties
stack_type associated wf_var_id managed_role_exprs
map from role to expression defines the roles managed by the stack with dedicated namespace answer the question : 'Is the elt at level X stored within stack granted with this role ?'
Guards (default policy)
_empty_stack_manage_guard _edit_stack_element_guard _view_stack_element_guard
16
Stack definition (3/3)
Implements IWorkflowStackDefinition Stack definitions registry Basic stack definitons
Simple stack definition Hierarchical stack definition
17
Public workflow tool API for stacks
getStackDefinitionsFor(self, ob) getStackDefinitionFor(self, ob, wf_var_id='') getStacksFor(self, ob) getStackFor(self, ob, stack_id) canManageStack(self, ob, stack_id) getWorkflowStackRegistry(self) getWorkflowStackDefRegistry(self) getWorkflowStackElementRegistry(self)
18
Transition extensions for stacks
Stack workflow flags
push / pop / reset / increase / decrease
Way of performing actions on given stacks through the use of transition flags Default DC workflow guard extended with stack guards. Update roles according to the stack definition policy after the transition has been executed.
19
State behaviors
push / pop / reset / increase / decrease necessary since several stacks can be defined on the same state. protect stacks
20
CPSWorkflow Status
Stable Project driven development In production since 2003 Stack workflow in production since the end of 2004 and especially in 2 large scaled and critical applications
Ministry of Justice (FR)
mails / folders management of the whole ministry. (goes live couple of weeks ago)
DAF (Direction des archives de France / French archives direction)
teleprocedure / archives management
Missing transition flag registry for being able to hook properly your own business
21
Z3/ECM workflow effort
Implementing a standard
XPDL (XML Process Definition Language) WFMC (Workflow Model Coalition) Available tools (Jawe) Interoperability document centric approach needed more powerful but ... ...much more complex. target complex biz apps
Activity based workflow
Hybrid model but constructed from the activity based one in this case
22
xpdlcore
Zope3 component aims to provide a Python full XPDL specification implementation Features :
XPDL tree modelization with Python objects (sort of DOM for XPDL) XPDL importer XPDL validation using Zope3 schemas.
based on lxml (http://codespeak.net/lxml)
23
zope.wfmc
Zope3 component Implements the wfmc specifications Python process interpretor provides a collection of workflow process components. Developed by Jim Fulton at ZC xpdl support
will use xpdlcore after 3.1 release (EP sprint last week)
24
ecm workflow
Zope3 component WFMC document centric workflow engine Process definitions repository Content object process association (placefulness) Process instances repository Process histories Content object PIDs annotations Binding the process on the content object. (WorkItem trick) Workflow security policy layer
25
ecmworkflow architecture
26
Status
xpdlcore
prototype not full xpdl specification implementation yet Supposed to move to the Zope3 trunk and be integrated with zope.wfmc. Work in progress (sprint last week) beta doesn't implement all the wfmc spec yet. alpha code architecture draft some more research remains to be done
27
zope.wfmc
ecm workflow
Documentation and lists
CPSWorkflow
CPSWorkflowHowTo tutorial product
http://svn.nuxeo.org/pub/CPSWorkflowHowTo http://www.cps-project.org
Documentation / tutorial
cps-users on http://lists.nuxeo.com/ cps-devel on http://lists.nuxeo.com/ Draft architecture overview
ECM Workflow
http://www.z3lab.org http://www.wfmc.org
28
WFMC
z3lab mailing list on http://lists.nuxeo.com
More information
About CPSWorkflow
http://www.cps-project.org http://svn.nuxeo.org/ http://www.z3lab.org http://svn.nuxeo.org/pub/z3lab/xpdlcore http://svn.nuxeo.org/pub/z3lab/ecmworkflow http://svn.zope.org/Zope3/trunk/src/zope/wfmc http://www.wfmc.org http://www.cps-project.org http://www.nuxeo.com
About Z3/ECM - Workflow
About CPS Platform
About Nuxeo
29