Author: derek Date: Sun Nov 12 16:20:20 2006 New Revision: 172 Added: sofaswitch/trunk/callflow/docs/description.dxy Removed: sofaswitch/trunk/callflow/docs/executionflow.dxy Log: Rename file and title and page description etc. Added: sofaswitch/trunk/callflow/docs/description.dxy ============================================================================== --- (empty file) +++ sofaswitch/trunk/callflow/docs/description.dxy Sun Nov 12 16:20:20 2006 @@ -0,0 +1,98 @@ +/*! \page pageCallFlow Detailed description of CallFlow + +\section secIntro Introduction + +We describe the operation of this utilitiy with a series of examples and +associated description. The first part of this document describes the +generation of the graph with the gui, and the second part describes the +running of the graph. + +\section secHelloWorld Hello World example +Perhaps the simplest example of a graph you can create is the standard "Hello +World" example, shown here. + +\image html helloworld.png + +Python will start executing at the very top box, process the code in the +middle, and then terminate at the bottom. Program flow is invariably top to +bottom. Arrows are drawn on the output and input of each box to indicate where +the flow is going. You will notice four black circles, filled, on this +graph. They indicate a connection between the different entitiy. The skull and +crossbones symbol indicates end this graph now. + +\section secForLoop For Loops + +The flow of execution is to follow the graph on the screen. Thus, when +given a graph like + +\image html forloop.png + +it will enter the for loop, and go around and around until the termination +condition is met. The for loop consists of the three boxes in the middle of +this image. On each iteration, a Python command is executed, which is defined +in the Python box in the very middle. You could, of course, put something +different in the middle of the for loop. + +The loop variable, initialisation and termination condition are set at the +start of the for loop. To change these, right click on the for loop box and +adjust accordingly. It will generate an exception if you fail to provide an +entry to the Initialise, Test or Increment fields. If this Python code is +incorrect, it will except also. Notice too that the variables all have the +word "self." as the first half. This ensures that variables in one graph will +not interfere with those of another graph. If you wrote a nested for loop, +they should use different variables. + +While processing each of the nodes in the supplied graph, it is ignoring +all timer events. Execution continues until it falls of the end of the graph, +or passes through an Eventer type structure and goes nowhere. + + +\section secEvent Event handling +We describe the handling of events in this section, with a simple example. +Consider the following graph + +\image html simpleevent.png + +Execution starts at the top, moves to the next node which sends off a request +to obtain a new worker node. Then, the eventer box is entered, where we +register to receive any event that contains the word "NEW" (we are searching +for all events advising of a new node). At which point, execution continues to +the right, and goes into the lower "execute python code" box, which prints a +message. Finally, execution moves into the bottom most box, and stops. + +At this point, we rely upon the twisted module in python to call methods +indicating that things have happened (e.g. a timer, data received from network +etc). On receipt of a message about a new node, the box on the star output of +the eventer is processed. In this case, python code is executed which reports +the id of the voip node created. Execution then moves to the end, and stops. + +Should there be a new event (which we have previously registered for with an +Eventer box) execution will return there. Consequently, in the above example, +every time a new node is created, execution will always move back to the left +most execute python box. + +Note that network events, timer events, other events, are only processed when +execution has stopped. + +\section secUsage Usage - selection cutting pasting etc + +You are going to create a new graph, or edit an existing graph. This is done +by selecting New from the menu, or loading an existing file. + +Individual items in the graph can be moved by left down on the item and +dragging to the desired position. To select and move multiple items, hold the +shift key down and select the desired items, and then drag. Alternatively, +select a region on the screen (left down, move to the opposite corner, left +up), shift button down, and drag. + + + + + + + + + + + +*/ \ No newline at end of file