Updated workflow states
authorThierry Florac <thierry.florac@onf.fr>
Thu, 08 Oct 2015 11:36:22 +0200
changeset 14 84c77a226560
parent 13 316232c0fbf4
child 15 182f33bba91d
Updated workflow states
src/pyams_workflow/workflow.py
--- a/src/pyams_workflow/workflow.py	Thu Oct 08 11:34:40 2015 +0200
+++ b/src/pyams_workflow/workflow.py	Thu Oct 08 11:36:22 2015 +0200
@@ -79,10 +79,25 @@
 class Workflow(object):
     """Workflow utility"""
 
-    def __init__(self, transitions, states, published_states=None):
+    def __init__(self, transitions, states,
+                 initial_state=None,
+                 update_states=None,
+                 readonly_states=None,
+                 protected_states=None,
+                 manager_states=None,
+                 published_states=None,
+                 waiting_states=None,
+                 retired_states=None):
         self.refresh(transitions)
         self.states = states
-        self.published_states = published_states or set()
+        self.initial_state = initial_state
+        self.update_states = set(update_states) if update_states else set()
+        self.readonly_states = set(readonly_states) if readonly_states else set()
+        self.protected_states = set(protected_states) if protected_states else set()
+        self.manager_states = set(manager_states) if manager_states else set()
+        self.published_states = set(published_states) if published_states else set()
+        self.waiting_states = set(waiting_states) if waiting_states else set()
+        self.retired_states = set(retired_states) if retired_states else set()
 
     def _register(self, transition):
         transitions = self._sources.setdefault(transition.source, {})