Previous Topic: Add Logic to LIST SCORING RECORD Using Action Block SynthesisNext Topic: Add an Entity View of Golfer


Edit the Action Diagram

Follow these steps:

  1. Expand all of the views. Notice that the Toolset created the export views necessary to produce a list of 1000 Scoring Records. That is because in the properties for the Scoring Record entity type, we set the maximum at 1000. Also, notice that it just lists Scoring Records in general, and not just those associated with a particular Golfer. In the properties for the relationship, we said a Golfer would maintain at most 40 Scoring Records, so we will change the export view to reflect that number, and change the READ EACH statement to only read Scoring Records associated with a particular Golfer. Other changes we will make will be to put the action diagram into the standard format for a procedure step action diagram (for example, initialize the exit state, put the logic within a case of command, and so on).
  2. To provide a list of scoring records for a particular golfer, we need to know which golfer we want the scoring records for. Therefore, we need a view of Golfer in the import view. In the action diagram, select IMPORTS:, then from the Main Menu select Edit, then Add View, and then Add Entity View….
  3. In the Add Import Entity View dialog, enter import in the Name entry field, change the drop-down menu to Always used as input, select GOLFER from the list of Entity Types, select USERID from the list of Entity Attributes, and then select the OK push button. If you have multiple adds turned on, select the Cancel push button to return to the action diagram.
  4. Now, given a particular Golfer Userid in our import views, we can produce a list of their Scoring Records in our export views. However, our export views can use a little cleanup as well. Notice that in our export views we have a Group View with a name of group export that occurs 1000 times. Within the group view (as indicated by the indentation), we have an Entity View of Scoring Record named export. Essentially, what we have is an array containing 1000 occurrences of the information contained in the Scoring Record.

    Since group views have nothing more than a name and a number of occurrences, it is generally good practice to give them meaningful names. This is particularly important when you have many group views in an action diagram.

    Double-click group export in the EXPORTS: and change the Name to export group of scoring records. Then, change the cardinality of the group view to an average of 20 and a maximum of 40, and then select the OK push button.

  5. Since the export scoring record is part of the group view, we want to rename it from export to export group. Double-click the view name export and change the Name to export group. Select the OK push button.
  6. The final thing we want to do with the export group view is to add a selection character. While a selection character is not needed for any processing logic we are going to be doing within the server procedure, it will be necessary for processing logic we will be doing within the client procedure. Since this export group view will be matched to an export group view in the client procedure that will contain the selection character, we need to add a selection character to this view to enable the view matching. To match a group view to another group view, the two views must have similar view structures.

    To add a view to the group view, select export group of scoring records. Then, from the Main Menu select Edit, then Add View, and Add Work View. In the Add Export Work View dialog, enter export group for the Name, select the work set IEF SUPPLIED from the list of Entity Types, select the attribute SELECT CHAR from the list of Work Attributes, and then select the OK push button. If you have multiple adds turned on, you will need to select the Cancel push button to return to the action diagram. Notice that the Selection Character has been added to the Group View as indicated by its indentation under the Group View name.