Author: Sebastian Bergmann
Date: 2006-10-03 09:09:22 +0200 (Tue, 03 Oct 2006)
New Revision: 3620

Log:
Update.
Modified:
   experimental/Workflow/design/design.txt

Modified: experimental/Workflow/design/design.txt
===================================================================
--- experimental/Workflow/design/design.txt     2006-10-02 16:34:06 UTC (rev 
3619)
+++ experimental/Workflow/design/design.txt     2006-10-03 07:09:22 UTC (rev 
3620)
@@ -194,45 +194,40 @@
     is encapsulated by a class that implements the
     ezcWorkflowServiceObject interface.
 
-      class ezcWorkflowTestServiceObject
-      implements ezcWorkflowServiceObject
+      class PrintSomething implements ezcWorkflowServiceObject
       {
-          private $message;
-
-          public function __construct ( $message )
+          public function execute( ezcWorkflowExecution $execution )
           {
-              $this->message = $message;
+              print 'something';
           }
 
-          public function execute( ezcWorkflowExecution $execution )
+          public function __toString()
           {
-              print $this->message;
+              return 'PrintSomething';
           }
       }
 
-      $foo = new ezcWorkflowNodeAction(
-        new ezcWorkflowTestServiceObject( 'foo' )
-      );
+      $print = new ezcWorkflowNodeAction( 'PrintSomething' );
 
-      $start->addOutNode( $foo );
-      $end->addInNode( $foo );
+      $start->addOutNode( $print );
+      $end->addInNode( $print );
 
   - ezcWorkflowNodeInput
 
     This type of node is used to model user interaction.
 
     The example below creates an ezcWorkflowNodeInput node that expects
-    an input field named "approval". The value of this field has to be
+    an input field named "choice". The value of this field has to be
     boolean.
 
       $input = new ezcWorkflowNodeInput(
         array(
-          'approval',
+          'choice',
           new ezcWorkflowNodeInputConstraintBoolean
         )
       );
 
-    When this node is executed it will check whether the "approval" field
+    When this node is executed it will check whether the "input" field
     is available (in the ezcWorkflowExecution object). If that is not the
     case then the workflow execution is suspended.
 
@@ -259,34 +254,59 @@
       Based on a decision or workflow control data, a number of several
       branches are chosen.
 
+    - Exclusive Choice (XOR-Split)
+
+      Based on a decision or workflow control data, one of several
+      branches is chosen.
+
+      This is a special case of the Multi-Choice (OR-Split) pattern.
+
       The example below creates an ezcWorkflowNodeBranch node that
-      conditionally activates one of two nodes, $foo and $bar, when it is
-      reached.
+      conditionally activates one of two nodes, $true and $false,
+      when it is reached.
 
         $xor = new ezcWorkflowNodeBranch;
-        $xor->addInNode( $start );
+        $xor->addInNode( $input );
 
         $xor->addConditionalOutNode(
-          $foo,
-          new ezcWorkflowCondition(
-            ...
+          $true,
+          new ezcWorkflowConditionIsTrue(
+            'choice'
           )
         );
 
         $xor->addConditionalOutNode(
-          $bar,
-          new ezcWorkflowCondition(
-            ...
+          $false,
+          new ezcWorkflowConditionIsFalse(
+            'choice'
           )
         );
 
-    - Exclusive Choice (XOR-Split)
+      Branching conditions are expressed using ezcWorkflowCondition objects.
+      These operate on fields ('choice' in the example above) that have been
+      filled by a previously executed ezcWorkflowNodeInput node.
 
-      Based on a decision or workflow control data, one of several
-      branches is chosen.
+      Below is a list of the available ezcWorkflowCondition classes:
 
-      This is just a special case of the Multi-Choice (OR-Split) pattern.
+        - ezcWorkflowConditionIsEqual( String $inputField, Mixed $value )
+        - ezcWorkflowConditionIsNotEqual( String $inputField, Mixed $value )
+        - ezcWorkflowConditionIsGreaterThan( String $inputField, Mixed $value )
+        - ezcWorkflowConditionIsEqualOrGreaterThan( String $inputField, Mixed 
$value )
+        - ezcWorkflowConditionIsLessThan( String $inputField, Mixed $value )
+        - ezcWorkflowConditionIsEqualOrLessThan( String $inputField, Mixed 
$value )
+        - ezcWorkflowConditionIsTrue( String $inputField )
+        - ezcWorkflowConditionIsFalse( String $inputField )
 
+      These can be combined using the following boolean operators:
+
+        - ezcWorkflowConditionNot( ezcWorkflowCondition $condition )
+        - ezcWorkflowConditionAnd( ezcWorkflowCondition[] $conditions )
+        - ezcWorkflowConditionOr( ezcWorkflowCondition[] $conditions )
+        - ezcWorkflowConditionXor( ezcWorkflowCondition[] $conditions )
+
+    An ezcWorkflowNodeBranch node can have both conditional and
+    unconditional outgoing nodes.
+
   - ezcWorkflowNodeSynchronization
 
     This class implements the Synchronization workflow pattern.

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to