Previous Topic: Create the Three New Server ProceduresNext Topic: Diagram Structure


Add Logic to MAINTAIN GOLFER

Follow these steps:

  1. To open the MAINTAIN GOLFER procedure step action diagram, select the MAINTAIN GOLFER procedure in the Network pane or the Hierarchy pane. Then, from the Menu Bar, select the Action Diagram Open the ADD GOLFER Action Diagram icon.

    Notice that Procedure Step Action Diagrams (PrADs) and Process Action Diagrams (PADs) look very similar. They each have Import views, Export views, Local views, and Entity Action view types, each of which are used for the same purposes in each diagram. One of the main differences between the two diagrams, however, is the way in which the views are generally handled. Since process action diagrams (and common action diagrams) usually only perform one activity, we can effectively starve their import and export views, only having in them exactly what is required for that one execution of the process. However, procedures typically support multiple processes. For example, this procedure—Maintain Golfer—is going to support adding new golfers, logging in golfers, updating golfers, calculating their handicap indexes, and deleting golfers.

    Individually, each of these processes only uses a small subset of the golfer's attributes. However, collectively, they usually end up using every attribute of the golfer. Therefore, for procedure steps (particularly for those that support multiple processes), the import and export views typically look identical, and typically end up having all of the attributes of the supported entity type in its import and export views. In fact, one of the reasons we chose to put all of the processes in this one procedure was that they had similar view requirements. So let us add the views required for this procedure.

  2. In the MAINTAIN GOLFER procedure step action diagram, select IMPORTS. Then select Edit from the Main Menu, select Add View, and then select Add Entity View….
  3. In the Add Import Entity View dialog, enter import in the Name entry field, select entity GOLFER in the Entity Types list, select entity GOLFER in the Entity Attributes list to select all of the attributes, and then select the OK push button. If you have multiple adds turned on, you will then need to select the Cancel push button to close the Add Import Entity View dialog.
  4. Expand the IMPORTS. See a prior section if you need help. Notice that all of the views are marked optional. This is acceptable, since on any one execution of this procedure step, only a subset of the import views will be required.
  5. Since the export view is going to look just like the import view, we can copy the import view to the export view. Select Entity View import golfer and press F8 on your keyboard, and with the cursor (which now resembles a hand), select EXPORTS. In the Copy Import Entity View dialog, enter export for the New name: entry field and then select the OK push button. Your export view should now look identical to the import view, notwithstanding the differences in view properties.
  6. Save your model.