Previous Topic: Edit the Action DiagramNext Topic: Modify the READ EACH Statement


Add an Entity View of Golfer

You should now be becoming more familiar with the three categories of views. The three categories are:

Entity views

Views of any information that you have modeled in your data model, an entity type. These would contain information about objects of interest to your business, like Golfers and Scoring Records.

Work views

Views of information needed that are not modeled in your data model. Examples of these would be things like selection characters, counters, flags, and subscripts. These would typically not be in a business data model, but can be required to support some functioning within your programs.

Group views

Mechanisms for grouping and creating arrays of other views. These other views can be entity views, work views, or even additional group views. What we have created earlier is an array of information that contains the combinations of a Select Character along with the Scoring Record's Date, Time, Adjusted Gross Score, Course Rating, Course Slope Rating, and Notice, which then occurs 40 times.

Within our action diagram logic, we will modify the READ EACH statement to read each scoring record for a given golfer, and for each scoring record we find, we will move it to the group view. Since our group view is using implicit indexing, CA Gen will handle incrementing the subscript for us automatically to move each occurrence found to the next position in the array. To support the read of Golfer, the final change we need to make to our views is to add an entity view of Golfer to our Entity Action views. Since this view will look just like the import view of Golfer, we can copy the import golfer to our ENTITY ACTIONS views.

Follow these steps:

  1. Select import golfer in the IMPORTS:. Then press F8 to copy this view, and with the cursor (which now resembles a hand) select ENTITY ACTIONS. Since we generally do not name our entity action views, leave the New name: field blank and select the OK push button to complete copying this view.
  2. Save the model now that the views are complete.