Here is the description of the components that make up an action diagram, how to use the action diagram editor, and how to edit a function’s action diagram.
Understanding Action Diagrams
Action diagrams record the basic constructs that make up a procedure.
The action diagram is used to specify the procedural steps that make up a Synon function.
From the Edit Database Relations panel:
1. Go to the function. At the Edit Database Relations panel, type F next to any relation for the file. The Edit Functions panel displays.
2. Go to the action diagram. Type F next to the selected function. The Edit Action Diagram panel displays
From the Open Functions panel:
Go to the action diagram.
At the Open Functions panel, type F next to the selected function and press Enter. The Edit Action Diagram panel displays.
From the Display All Functions panel:
1. Go to Display Services. From within Synon/2E, press F17. The Display Services Menu appears.
2. Go to the list of all functions. Select the Display all functions option and press Enter. The Display All Functions panel appears.
3. Go to the action diagram. Type F next to the selected function and press Enter.
The Edit Action Diagram panel displays.
Specifying an Action in an Action Diagram
You specify actions using the Action Diagram Editor. Specifying an action is a two-step process.
First you specify where in the action diagram you want the action to be executed, then you specify the function details for the new action.
Adding an Action: Specify IA against the line in the action diagram where you want to add the action:
Specifying a Function as an Action
To specify the details for the new action, enter F against the line just added:
Alternatively, you can add or specify a function as an action in one operation by entering IAF in the subfile selection column.
Naming a Function as an Action
This will provide a subsidiary display on which you can specify the name of the function that constitutes the action.
The display will be preloaded with a ? in the Function file and Function fields to facilitate inquiries for these fields.
Specifying Parameters for an Action Function
If there are any parameters for the called function, you can specify which fields from which contexts within the calling function are to be passed as parameters. To do so, press F9.
User Points
The majority of the Synon/2E standard functions have default action diagrams.
The exceptions are Execute User Source (EXCUSRSRC) and Execute User Program (EXCUSRPGM).
You can insert logic into the action diagram to add processing that is specific to that function.
The areas that you can modify in the action diagram are called user points.
The user points vary for each standard function and are accessed according to the function.
User points are identified in the action diagram of a function by arrows, made up of a chevron and two dashes, in the right-hand margin of the Edit Action Diagram panel.
To list and access the user points in an action diagram, press F5 to display the available user points for the function.
The Action Diagram User Point window displays:
If the user points contain user defined action diagram statements, they are identified by three chevrons in the right-hand margin of the window.
Understanding Constructs
Constructs are the basic building blocks of an action diagram. By combining different types of constructs, you define the procedural logic of an action diagram.
The action diagram allows those basic constructs, action and condition, to be combined into other types of constructs.
The combination constructs are as follows:
· sequential
· conditional
· iterative
Synon executes all actions in a bracket construct in order, from top to bottom.
The following is an example of the presentation convention for action diagrams.
Sequential
Sequential statements are the simplest of the constructs.
They specify a list of actions or other constructs that are executed in the order in which they are written.
The logic that you insert in a sequential statement will normally be executed as a subroutine within the HLL program.
Sequential statements are denoted by brackets that enclose dotted lines.
Conditional
Conditional constructs allow actions to be conditionally executed within the action diagram logic.
Conditional constructs generally conform to nested IF THEN ELSE logic statements or SELECT sets.
Conditional constructs are called CASE blocks because they are denoted by CASE and ENDCASE statements.
More complex conditions can be constructed using compound conditions.
You use CASE blocks to execute actions based on the condition being tested.
Actions within a condition construct are generated as inline code.
Condition constructs are denoted by brackets that enclose broken vertical bars.
Iterative
Iterative constructs represent repetitive logic that executes when a specific condition is true.
The iterative statement is denoted by REPEAT WHILE and ENDWHILE statements.
Synon implements the iterative construct as an HLL subroutine.
You must define a controlling condition within the iterative loop to determine whether the logic is to be repeated.
The actions within the iterative construct will be executed only while the initial condition is true.
Iterative constructs are denoted by brackets that enclose solid vertical lines.
Capabilities of Constructs
You can nest constructs.
For example, you could insert a conditional CASE construct within a REPEAT WHILE construct; in this manner you test for a conditional value while the controlling condition is executed.
You can nest sequential actions within any other construct.
You can exit a construct at any point within the processing logic by means of either one of two built-in functions: *QUIT or *EXIT PROGRAM.
The *EXIT PROGRAM built-in function allows you to leave the current HLL program or Synon external function.
The *QUIT built-in function allows you to leave the current subroutine logic of the sequential construct block or Synon internal function.
There are consequences for using *QUIT and *EXIT PROGRAM within constructs.
Other constructs are implemented as inline code within the current subroutine.
The *QUIT built-in function allows you to leave the current subroutine logic of the construct block.
The *EXIT PROGRAM built-in function allows you to leave the current HLL program.