diff --git a/stateful/README.txt b/stateful/README.txt index 93a5eeb..ef27cdb 100644 --- a/stateful/README.txt +++ b/stateful/README.txt @@ -44,6 +44,9 @@ We'll use a predefined simple publishing workflow that. >>> demo.getState() 'draft' + >>> [t.title for t in demo.getAvailableTransitions()] + ['publish', 'hide', 'archive', 'remove'] + If we try to execute a transition that is not an outgoing transition of the current state we get an error. diff --git a/stateful/publishing.py b/stateful/publishing.py index 1f45f4f..69c5128 100644 --- a/stateful/publishing.py +++ b/stateful/publishing.py @@ -33,11 +33,15 @@ from cybertools.stateful.interfaces import IStatesDefinition @implementer(IStatesDefinition) def simplePublishing(): return StatesDefinition('publishing', - State('private', 'private', ('show',)), - State('draft', 'draft', ('publish', 'hide',)), - State('published', 'published', ('retract',)), + State('private', 'private', ('show', 'archive', 'remove')), + State('draft', 'draft', ('publish', 'hide', 'archive', 'remove')), + State('published', 'published', ('retract', 'archive')), + State('archived', 'archived', ('show', 'remove')), + State('removed', 'removed', ('show',)), Transition('show', 'show', 'draft'), Transition('hide', 'hide', 'private'), Transition('publish', 'publish', 'published'), Transition('retract', 'retract', 'draft'), + Transition('archive', 'archive', 'archived'), + Transition('remove', 'remove', 'removed'), initialState='draft')