[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/workflow - __init__.py:1.5 stateful.py:1.3

Ulrich Eck ueck@net-labs.de
Wed, 5 Feb 2003 20:03:55 -0500


Update of /cvs-repository/Zope3/src/zope/app/interfaces/workflow
In directory cvs.zope.org:/tmp/cvs-serv29377

Modified Files:
	__init__.py stateful.py 
Log Message:
improved interfaces for workflow


=== Zope3/src/zope/app/interfaces/workflow/__init__.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/interfaces/workflow/__init__.py:1.4	Tue Feb  4 16:35:42 2003
+++ Zope3/src/zope/app/interfaces/workflow/__init__.py	Wed Feb  5 20:03:51 2003
@@ -19,6 +19,8 @@
 
 from zope.interface import Interface
 from zope.interface import Attribute
+from zope.interface.common.mapping \
+     import IEnumerableMapping
 from zope.app.interfaces.container import IContainer
 from zope.app.interfaces.services.configuration \
      import INamedComponentConfiguration
@@ -52,6 +54,12 @@
 
 
 
+class IProcessDefinitionConfiguration(INamedComponentConfiguration):
+    """Configuration for a workflow process definition.
+    """
+
+
+
 
 
 
@@ -69,15 +77,13 @@
         """
 
 
-
-class IProcessDefinitionConfiguration(INamedComponentConfiguration):
-    """Configuration for a workflow process definition.
+class IProcessDefinitionElementContainer(IContainer):
+    """Abstract Interface for ProcessDefinitionElementContainers.
     """
 
 
 
 
-
 class IProcessInstance(Interface):
     """Workflow process instance.
 
@@ -90,9 +96,14 @@
 
 
 
+
+
 class IProcessInstanceContainer(IContainer):
     """Workflow process instance container.
     """
+
+
+
 
 
 


=== Zope3/src/zope/app/interfaces/workflow/stateful.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/interfaces/workflow/stateful.py:1.2	Tue Feb  4 11:46:39 2003
+++ Zope3/src/zope/app/interfaces/workflow/stateful.py	Wed Feb  5 20:03:51 2003
@@ -19,45 +19,93 @@
 from zope.interface import Interface, Attribute
 from zope.app.interfaces.workflow import IProcessDefinition
 from zope.app.interfaces.workflow import IProcessInstance
+from zope.app.interfaces.workflow import IProcessDefinitionElementContainer
+
+
+class IState(Interface):
+    """Interface for state of a stateful workflow process definition.
+    """
+
+    # more attributes/methods to come
+    # description = Attribute("Description of the State.")
+
+
+class IStatefulStatesContainer(IProcessDefinitionElementContainer):
+    """Container that stores States.
+    """
+
+
+
+class ITransition(Interface):
+    """Stateful workflow transition.
+    """
+
+    sourceState = Attribute("Name of the source state.")
+
+    destinationState = Attribute("Name of the destination state.")
+
+    condition = Attribute("""The condition that is evaluated to decide if \
+                             the condition is fired or not.""")
+    # more attributes/methods to come
+    # permission
+    # description
+
+
+class IStatefulTransitionsContainer(IProcessDefinitionElementContainer):
+    """Container that stores Transitions.
+    """
+
+
+
 
 class IStatefulProcessDefinition(IProcessDefinition):
     """Interface for stateful workflow process definition.
     """
 
+    # more attributes to come
+    # relevantDataSchema (persistent schema)
+    # relevantDataPermissions (checker)
+
+    states = Attribute("State objects container.")
+
+    transitions = Attribute("Transition objects container.")
+
+
+
     def addState(name, state):
         """Add a IState to the process definition.
         """
-
+    
     def getState(name):
         """Get the named state.
         """
-
+    
     def removeState(name):
         """Remove a state from the process definition
-
+    
         Raises ValueError exception if trying to delete the initial state.
         """
-
+    
     def getStateNames():
         """Get the state names.
         """
-
+    
     def getInitialStateName():
         """Get the name of the initial state.
         """
-
+    
     def addTransition(name, transition):
         """Add a ITransition to the process definition.
         """
-
+    
     def getTransition(name):
         """Get the named transition.
         """
-
+    
     def removeTransition(name):
         """Remove a transition from the process definition.
         """
-
+    
     def getTransitionNames():
         """Get the transition names.
         """
@@ -65,30 +113,23 @@
 
 
 
-class IState(Interface):
-    """Interface for state of a stateful workflow process definition.
-    """
-
-
-class ITransition(Interface):
-    """Stateful workflow transition.
-    """
-
-    sourceState = Attribute("Name of the source state.")
-
-    destinationState = Attribute("Name of the destination state.")
-
-    condition = Attribute("""The condition that is evaluated to decide if \
-                             the condition is fired or not.""")
-
-
-
 class IStatefulProcessInstance(IProcessInstance):
     """Workflow process instance.
 
     Represents the instance of a process defined by a
     StatefulProcessDefinition.
     """
+
+    # more attributes to come
+    # relevantData (an object with attributes
+    #               with permissions and schema)
+
+
+    def initialize():
+        """Initialize the ProcessInstance.
+
+        set Initial State and create relevant Data.
+        """
 
     def getOutgoingTransitions():
         """Get the outgoing transitions.