[Zope3-checkins] SVN: Zope3/trunk/src/zope/wfmc/ ITransitionDefinition was not well-defined,

Adam Groszer adamg at fw.hu
Fri Sep 8 08:28:00 EDT 2006


Log message for revision 70052:
  ITransitionDefinition was not well-defined,
  minor flaws in process elements __name__ and description handling and reading from XPDL

Changed:
  U   Zope3/trunk/src/zope/wfmc/interfaces.py
  U   Zope3/trunk/src/zope/wfmc/process.py
  U   Zope3/trunk/src/zope/wfmc/publication.xpdl
  U   Zope3/trunk/src/zope/wfmc/xpdl.py
  U   Zope3/trunk/src/zope/wfmc/xpdl.txt

-=-
Modified: Zope3/trunk/src/zope/wfmc/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/wfmc/interfaces.py	2006-09-08 11:24:45 UTC (rev 70051)
+++ Zope3/trunk/src/zope/wfmc/interfaces.py	2006-09-08 12:27:59 UTC (rev 70052)
@@ -133,6 +133,10 @@
     """
 
     id = interface.Attribute("Activity identifier")
+    
+    __name__ = interface.Attribute("Activity Name")
+    
+    description = interface.Attribute("Description")
 
     def addApplication(id, *parameters):
         """Declare that the activity uses the identified activity
@@ -167,6 +171,21 @@
 class ITransitionDefinition(interface.Interface):
     """Transition definition
     """
+    id = interface.Attribute("Transition identifier")
+    
+    __name__ = interface.Attribute(
+        "Transition name, Text used to identify the Transition.")
+    
+    description = interface.Attribute("Description")
+    
+    from_ = interface.Attribute(
+        "Determines the FROM source of a Transition. (Activity Identifier)")
+    
+    to = interface.Attribute(
+        "Determines the TO target of a Transition (Activity Identifier)")
+    
+    condition = interface.Attribute(
+        "A Transition condition expression based on relevant data field.")
 
 class IProcess(interface.Interface):
     """Process instance

Modified: Zope3/trunk/src/zope/wfmc/process.py
===================================================================
--- Zope3/trunk/src/zope/wfmc/process.py	2006-09-08 11:24:45 UTC (rev 70051)
+++ Zope3/trunk/src/zope/wfmc/process.py	2006-09-08 12:27:59 UTC (rev 70052)
@@ -33,11 +33,13 @@
 
     interface.implements(interfaces.ITransitionDefinition)
 
-    def __init__(self, from_, to, condition=always_true, id=None):
+    def __init__(self, from_, to, condition=always_true, id=None, __name__=None):
         self.id = id
         self.from_ = from_
         self.to = to
         self.condition = condition
+        self.__name__ = __name__
+        self.description = None
 
     def __repr__(self):
         return "TransitionDefinition(from=%r, to=%r)" %(self.from_, self.to)
@@ -57,6 +59,7 @@
         self.applications = {}
         self.participants = {}
         self.parameters = ()
+        self.description = None
 
     def __repr__(self):
         return "ProcessDefinition(%r)" % self.id
@@ -144,6 +147,7 @@
         self.transition_outgoing = self.explicit_outgoing = ()
         self.applications = ()
         self.andJoinSetting = self.andSplitSetting = False
+        self.description = None
 
     def andSplit(self, setting):
         self.andSplitSetting = setting
@@ -486,6 +490,7 @@
 
     def __init__(self, name=None):
         self.__name__ = name
+        self.description = None
 
     def __repr__(self):
         return "Participant(%r)" %self.__name__

Modified: Zope3/trunk/src/zope/wfmc/publication.xpdl
===================================================================
--- Zope3/trunk/src/zope/wfmc/publication.xpdl	2006-09-08 11:24:45 UTC (rev 70051)
+++ Zope3/trunk/src/zope/wfmc/publication.xpdl	2006-09-08 12:27:59 UTC (rev 70052)
@@ -29,6 +29,7 @@
         <WorkflowProcess AccessLevel="PUBLIC" Id="Publication" Name="Publication">
             <ProcessHeader DurationUnit="D">
                 <Created>2005-01-06 16:29:02</Created>
+                <Description>This is the sample process</Description>
             </ProcessHeader>
             <RedefinableHeader PublicationStatus="UNDER_TEST"/>
             <FormalParameters>
@@ -86,6 +87,7 @@
                 </Participant>
                 <Participant Id="tech1" Name="Technical Reviewer 1">
                     <ParticipantType Type="HUMAN"/>
+                    <Description>He is a smart guy.</Description>
                 </Participant>
                 <Participant Id="tech2" Name="Technical Reviewer 2">
                     <ParticipantType Type="HUMAN"/>
@@ -192,6 +194,7 @@
                     </ExtendedAttributes>
                 </Activity>
                 <Activity Id="tech1" Name="Technical Review 1">
+                    <Description>This is the first Technical Review.</Description>
                     <Implementation>
                         <Tool Id="tech_review" Type="APPLICATION">
                             <ActualParameters>
@@ -386,13 +389,13 @@
                 </Activity>
             </Activities>
             <Transitions>
-                <Transition From="prepare" Id="Publication_Tra2" Name="Transition" To="tech1">
+                <Transition From="prepare" Id="Publication_Tra2" Name="Transition to Tech Review 1" To="tech1">
                     <ExtendedAttributes>
                         <ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
                         <ExtendedAttribute Name="BreakPoint" Value="160;160;1"/>
                     </ExtendedAttributes>
                 </Transition>
-                <Transition From="prepare" Id="Publication_Tra3" Name="Transition" To="tech2">
+                <Transition From="prepare" Id="Publication_Tra3" Name="Transition to Tech Review 2" To="tech2">
                     <ExtendedAttributes>
                         <ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
                         <ExtendedAttribute Name="BreakPoint" Value="210;290;1"/>
@@ -421,6 +424,7 @@
                 </Transition>
                 <Transition From="review" Id="Publication_Tra8" Name="Transition" To="final">
                     <Condition Type="CONDITION">ed_changes</Condition>
+                    <Description>Use this transition if there are editorial changes required.</Description>
                     <ExtendedAttributes>
                         <ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
                     </ExtendedAttributes>
@@ -462,6 +466,6 @@
     </WorkflowProcesses>
     <ExtendedAttributes>
         <ExtendedAttribute Name="MadeBy" Value="JaWE"/>
-        <ExtendedAttribute Name="Version" Value="1.2"/>
+        <ExtendedAttribute Name="Version" Value="1.4.2"/>
     </ExtendedAttributes>
 </Package>

Modified: Zope3/trunk/src/zope/wfmc/xpdl.py
===================================================================
--- Zope3/trunk/src/zope/wfmc/xpdl.py	2006-09-08 11:24:45 UTC (rev 70051)
+++ Zope3/trunk/src/zope/wfmc/xpdl.py	2006-09-08 12:27:59 UTC (rev 70052)
@@ -155,6 +155,7 @@
         name = attrs.get((None, 'Name'))
         participant = self.ParticipantFactory(name)
         self.stack[-1].defineParticipants(**{str(id): participant})
+        return participant
     start_handlers[(xpdlns, 'Participant')] = Participant
 
     def Application(self, attrs):
@@ -236,6 +237,7 @@
         to = attrs.get((None, 'To'))
         transition = self.TransitionDefinitionFactory(from_, to)
         transition.id = id
+        transition.__name__ = name
         return transition
     start_handlers[(xpdlns, 'Transition')] = Transition
     

Modified: Zope3/trunk/src/zope/wfmc/xpdl.txt
===================================================================
--- Zope3/trunk/src/zope/wfmc/xpdl.txt	2006-09-08 11:24:45 UTC (rev 70051)
+++ Zope3/trunk/src/zope/wfmc/xpdl.txt	2006-09-08 12:27:59 UTC (rev 70052)
@@ -352,7 +352,13 @@
 ============
 
 Most process elements can have names and descriptions.
-
+    
+    >>> pd.__name__
+    u'Publication'
+    
+    >>> pd.description
+    u'This is the sample process'
+    
     >>> pd.applications['prepare'].__name__
     u'Prepare'
 
@@ -362,5 +368,21 @@
     >>> pd.activities['tech1'].__name__
     u'Technical Review 1'
     
+    >>> pd.activities['tech1'].description
+    u'This is the first Technical Review.'
+    
     >>> pd.participants['tech1'].__name__
-    u'Technical Reviewer 1'
\ No newline at end of file
+    u'Technical Reviewer 1'
+    
+    >>> pd.participants['tech1'].description
+    u'He is a smart guy.'
+    
+    >>> sorted([item.__name__ for item in pd.transitions])
+        [u'Transition', u'Transition', u'Transition', u'Transition',
+        u'Transition', u'Transition', u'Transition', u'Transition',
+        u'Transition', u'Transition', u'Transition to Tech Review 1',
+        u'Transition to Tech Review 2']
+    
+    >>> sorted([item.description for item in pd.transitions])
+        [None, None, None, None, None, None, None, None, None, None, None,
+        u'Use this transition if there are editorial changes required.']
\ No newline at end of file



More information about the Zope3-Checkins mailing list