[Zope3-checkins] CVS: Packages3/workflow/stateful - definition.py:1.6 instance.py:1.8
Ulrich Eck
ueck@net-labs.de
Wed, 26 Mar 2003 13:27:43 -0500
Update of /cvs-repository/Packages3/workflow/stateful
In directory cvs.zope.org:/tmp/cvs-serv19791/stateful
Modified Files:
definition.py instance.py
Log Message:
fixed some errors for Automatic Transitions and ommited Relevant Data Schema
=== Packages3/workflow/stateful/definition.py 1.5 => 1.6 ===
--- Packages3/workflow/stateful/definition.py:1.5 Wed Mar 26 12:43:38 2003
+++ Packages3/workflow/stateful/definition.py Wed Mar 26 13:27:42 2003
@@ -61,8 +61,8 @@
super(Transition, self).__init__()
self.__source = source
self.__destination = destination
- self.__condition = condition
- self.__permission = permission
+ self.__condition = condition or None
+ self.__permission = permission or None
self.__triggerMode = triggerMode
=== Packages3/workflow/stateful/instance.py 1.7 => 1.8 ===
--- Packages3/workflow/stateful/instance.py:1.7 Wed Mar 26 12:43:38 2003
+++ Packages3/workflow/stateful/instance.py Wed Mar 26 13:27:42 2003
@@ -91,7 +91,9 @@
else:
self._data = None
# setup permission on data
-
+
+ # check for Automatic Transitions
+ self._checkAndFireAuto()
initialize = ContextMethod(initialize)
@@ -162,6 +164,8 @@
def _evaluateCondition(self, transition):
"""Evaluate a condition in context of relevant-data.
"""
+ if not transition.condition:
+ return True
expr = Engine.compile(transition.condition)
return expr(Engine.getContext( contexts=self._getContext(transition) ))
@@ -184,7 +188,7 @@
for name in outgoing_transitions:
trans = clean_pd.transitions[name]
if trans.triggerMode == 'Automatic':
- self.fireTransitions(name)
+ self.fireTransition(name)
return
_checkAndFireAuto = ContextMethod(_checkAndFireAuto)