Sequence Diagrams

The sequence diagram displays the flow of your application logic. It shows how the functions of the application call and/or are called by other functions.

To display a sequence diagram:

  1. Open the Genero source code (4gl) file in Code Editor and right-click either:
    • A function name, to display the diagram for that function.
    • The word MAIN in the MAIN program block, to display the diagram for the entire application.
    Tip: Alternatively, open the dependency diagram, select the link (arrow) between items, and right-click a function in the Function Calls view.
  2. Select Open Sequence Diagram.

    If you do not see the menu option, rebuild your application.

The diagram displays as in Figure 1:

  • The starting point of the application is indicated by the stick-figure actor, the user who interacts with the application.
  • The boxes at the top of the diagram represent the source code modules of the application.
  • The vertical lines below those boxes represent the execution flow of the program within those modules.
  • Boxes on the vertical lines represent the functions in each module. The sequence is indicated by the order in which the boxes are listed; functions which are called by other functions have their boxes stacked on top.
  • A plus (+) sign indicates that the function has sub calls that are hidden in the diagram. The function can be expanded by clicking on the plus sign.
  • Horizontal arrows display the interaction between functions, the messages (calls) that are exchanged between them, and the order in which the calls occur.
Figure: Sequence Diagram

This figure is a screenshot of a sequence diagram. See the surrounding text for more information about the Sequence Diagram shown.

In Figure 1, the user interacts with the MAIN program block (function), located in the custmain.4gl module, which calls the query_cust function in the custquery.4gl module. The query_cust function calls get_cust_cnt, cust_select, and display_cust, all located in the same module, and then returns to the MAIN program block.

When you select an item in the sequence diagram, it is highlighted in the Sequence Diagram Structure tree. You can select an item in the Sequence Diagram Structure tree to find it in the sequence diagram.

To change the display of the sequence diagram:
  • Zoom in and out by holding down the Ctrl key while using the mouse wheel.
  • Doubleclick on a function block to expand or collapse it.
  • Right-click on the background and select Show all Sub Calls or Hide all Sub Calls.
  • Change the maximum number of dependencies (default = 1) by selecting Tools > Preferences (or, if you are on a Mac, Genero Studio > Preferences), then Sequence Diagram.
Tip: To open the source code (4gl) file for a function, right-click an item in either the diagram or structure view, and select View source. Using both View source and Open Sequence Diagram, you can switch back and forth between the source and the diagram.