[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Workflow - IWorkflowEngine.py:1.4.4.2 WorkflowProcessDefinition.py:1.1.2.1 IWorkflowProcessDefinition.py:1.1.2.3 IWorkflowProcessInstance.py:1.2.24.3 IWorkflowService.py:1.2.24.3

Florent Guillaume fg@nuxeo.com
Wed, 4 Dec 2002 06:15:29 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Workflow
In directory cvs.zope.org:/tmp/cvs-serv26998

Modified Files:
      Tag: sprintathon-wf-branch
	IWorkflowProcessDefinition.py IWorkflowProcessInstance.py 
	IWorkflowService.py 
Added Files:
      Tag: sprintathon-wf-branch
	IWorkflowEngine.py WorkflowProcessDefinition.py 
Log Message:
Simple empty process definition. For the engine part, use a separate
interface. Create a dummy implementation of a process instance for testing
purposes.



=== Zope3/lib/python/Zope/App/Workflow/IWorkflowEngine.py 1.4.4.1 => 1.4.4.2 ===
--- /dev/null	Wed Dec  4 06:15:28 2002
+++ Zope3/lib/python/Zope/App/Workflow/IWorkflowEngine.py	Wed Dec  4 06:15:27 2002
@@ -0,0 +1,33 @@
+##############################################################################
+#
+# Copyright (c) 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+"""Interfaces for workflow process engine.
+
+An engine is a way to execute a process instance.
+
+$Id$
+"""
+
+from Interface import Interface
+from Interface.Attribute import Attribute
+
+
+class IWorkflowEngine(Interface):
+    """Interface to interact with a process instance."""
+
+    def start():
+        """Start a process instance."""
+
+    def finish():
+        """Finish a process instance."""


=== Added File Zope3/lib/python/Zope/App/Workflow/WorkflowProcessDefinition.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

"""Implementation of workflow process definition.

$Id: WorkflowProcessDefinition.py,v 1.1.2.1 2002/12/04 11:15:27 efge Exp $
"""

from Persistence import Persistent
from Zope.App.Workflow.IWorkflowProcessDefinition import \
     IWorkflowProcessDefinition
## from Zope.ComponentArchitecture import getServiceManager
## from Zope.ContextWrapper import ContextMethod
## from Zope.Security.Checker import CheckerPublic
## from Zope.App.Traversing import traverse
## from Zope.App.Traversing import getPhysicalPathString
## from Zope.App.DependencyFramework.IDependable import IDependable
## from Zope.App.DependencyFramework.Exceptions import DependencyError
## from Zope.App.OFS.Container.IAddNotifiable import IAddNotifiable
## from Zope.App.OFS.Container.IDeleteNotifiable import IDeleteNotifiable
## from Zope.App.OFS.Services.Configuration import ConfigurationStatusProperty
## from Zope.App.OFS.Services.ConfigurationInterfaces import Active
## from Zope.App.OFS.Services.ConfigurationInterfaces import Registered
## from Zope.App.OFS.Services.ConfigurationInterfaces import Unregistered


class WorkflowProcessDefinition(Persistent):
    """Process definition.
    """

    __implements__ = IWorkflowProcessDefinition

    def __init__(self):
        super(WorkflowProcessDefinition, self).__init__(self)

    name = None

    ############################################################
    # Implementation methods for interface
    # Zope.App.Workflow.IWorkflowProcessDefinition

    def createProcessInstance(self):
        return None

    #
    ############################################################


=== Zope3/lib/python/Zope/App/Workflow/IWorkflowProcessDefinition.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/lib/python/Zope/App/Workflow/IWorkflowProcessDefinition.py:1.1.2.2	Wed Dec  4 04:05:11 2002
+++ Zope3/lib/python/Zope/App/Workflow/IWorkflowProcessDefinition.py	Wed Dec  4 06:15:27 2002
@@ -2,79 +2,31 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
-"""Interfaces for Workflow Process Definition.
+"""Interfaces for workflow process definition.
 
 $Id$
 """
 
 from Interface import Interface
+from Interface.Attribute import Attribute
 
-class IWorkflowProcessDefinition(Interface):
-    """Interface for workflow process definition.
-
-    """
-
-    name = Attribute("""The name of the ProcessDefinition""")
-
-
-    # XXX drop
-    workflow_implementation_type = Attribute("""The name of the workflow type""")
-    workflow_relevant_data_definition = Attribute("""The definition of workflow \
-    relevant data of type [{name:'', data_tpye:''}]""")
-    # relevant data declaration may be sequence of objects instead of a dictionary
-
-
-
-
-    # XXX Implementation specific below ????
-    # XXX use explicit Names (State/Activity) instead of generalized ones
 
-    nodes = Attribute("""The sequence of nodes""")
-    transitions = Attribute("""The sequence of transitions""")
-
-
-    def addNode(id): #we need a name that will satisfy WfMC and State WF
-        """Add a node to the Process Definition
-        """
-
-    def addTransition(id):
-        """Add a transition to the Process Definition
-        """
-
-    def deleteNode(node_id): #we need a name that will satisfy WfMC and State WF
-        """Delete a node from the Process Definition
-        """
-
-    def deleteTransition(transition_id):
-        """Delete a transition from the Process Definition
-        """
-
-    def getNodeNames(filter):
-        """Return a sequence of node names
-        """
-
-    def getTransitionNames(filter):
-        """Return a sequence of transition names
-        """
+class IWorkflowProcessDefinition(Interface):
+    """Workflow process definition."""
 
-    def getNode(node_id):
-        """Return the node object
-        """
+    name = Attribute("The name of the workflow process definition.")
 
-    def getTransition(transition_id):
-        """Return the transition object
-        """
+    def createProcessInstance():
+        """Create a new process instance for this process definition.
 
-    def getWorkflowType():
-        """Return the type of workflow
-        """
+        Returns an IWorkflowProcessInstance."""


=== Zope3/lib/python/Zope/App/Workflow/IWorkflowProcessInstance.py 1.2.24.2 => 1.2.24.3 ===
--- Zope3/lib/python/Zope/App/Workflow/IWorkflowProcessInstance.py:1.2.24.2	Wed Dec  4 04:05:11 2002
+++ Zope3/lib/python/Zope/App/Workflow/IWorkflowProcessInstance.py	Wed Dec  4 06:15:27 2002
@@ -2,51 +2,38 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
-"""
-    Interfaces for Workflow Process Instance.
+"""Interfaces for workflow process instances.
+
 $Id$
 """
 
 from Interface import Interface
+from Interface.Attribute import Attribute
 
-class IWorkflowProcessInstance( Interface ):
-    """Interface for workflow process instance.
 
-        Represents the instance of a Process defined by a WorkflowProcessDefinition."""
+class IWorkflowProcessInstance(Interface):
+    """Workflow process instance.
 
-    status = Attribute("""The state in which the workitem is""")
-    
-    # XXX no private attribute are exposed in interfaces
-    workitem_list = Attribute("""The list of WorlflowWorkitem for the current WorkflowProcessInstance""")
-    process_definition = Attribute("""The WorkflowProcessDefinition used to create this instance""")
-    
-    def setStatus():  # XXX Property ??
-        """Set the process instance status
-        """
-        
-    def getProcessDefinition():
-        """Gets the process definition for this process instance."""
-
-    def getStatus():  # XXX Property
-        """
-           Report the status
-        """
-    
-    def listWorkitems(filter):
-        """
-           List all contained workitems
-        """
+    Represents the instance of a process defined by a
+    WorkflowProcessDefinition.
+    """
 
-    def getWorkitem(wi_id):
-        """Gets a workitem by id."""
+    status = Attribute("The state in which the workitem is.")
 
+    processDefinition = Attribute("The process definition.")
+
+    def getWorkitems():
+        """Get the workitems."""
+
+    def getWorkitem(wi_id):
+        """Get a workitem by id."""


=== Zope3/lib/python/Zope/App/Workflow/IWorkflowService.py 1.2.24.2 => 1.2.24.3 ===
--- Zope3/lib/python/Zope/App/Workflow/IWorkflowService.py:1.2.24.2	Wed Dec  4 05:39:39 2002
+++ Zope3/lib/python/Zope/App/Workflow/IWorkflowService.py	Wed Dec  4 06:15:27 2002
@@ -34,6 +34,9 @@
     def getProcessDefinition(name):
         """Return the definition for name."""
 
+    def createProcessInstance(definition_name):
+        """Create a process instance from a process definition."""
+
     # configuration
 
     def queryConfigurations(definition_name):