Previous Topic: Add Action Diagram StatementsNext Topic: Add the Process Logic to DELETE GOLFER


Set Exit States

Follow these steps:

  1. For the WHEN not found condition, set the exit state to the exit-state-value GOLFER NF. Refer to the prior action diagram instructions if you need help.
  2. When the read of golfer is successful, we want to check that the password entered is the same as the one we have on file for them. Select the WHEN successful clause, from the Menu Bar select Edit, then Add Statement, then If….
  3. From the choices provided in the bottom panel of the Add Statement dialog box, select attribute view, then golfer, then password, then IS EQUAL TO, then character view, then import golfer, then password, and finally select the Add pushbutton to add the statement to the action diagram.
  4. If the two passwords are equal, then we want to move the golfer’s name and handicap index that we read off the database to the export view. From the Menu Bar select Edit, then Add Statement, and then select Move….
  5. From the choices provided in the bottom panel of the Add Statement dialog box, select golfer. The Toolset fills in the rest of the statement for us, moving the golfer to the export golfer. This was a correct assumption on the Toolset’s part; but if we had something else in mind, we could select the Undo pushbutton and make a different selection.

    Select the Add pushbutton to add the statement to the action diagram.

  6. If the passwords do not match, then we want to set an appropriate exit-statevalue. Below the MOVE statement (which should still be highlighted), we want to add an “else” statement. From the Menu Bar, select Edit, select Add Statement, and then select the Else statement.
  7. To set the exit state, from the Tool Palette select Exit State Is, and then (with the crosshairs) select the ELSE statement. If necessary, in the Exit State Selection list, expand the <Global Exit States>.
  8. There isn’t an appropriate exit-state-value value available, so we will need to create a new one.

    Select <Global Exit States>, then select the Add… pushbutton. For the (new object) Properties, enter golfer password invalid in the Exit State Name: entry field, select Error for the Message Type, and enter the Message Text The password entered is invalid. Please re-enter your password. Then select the OK pushbutton to add it to the list. If multiple adds is turned on, select the Cancel pushbutton to close the (new object) Properties dialog box. The new exit-state-value should be highlighted. Select the Select pushbutton to select it and then select the Add pushbutton to add the statement to the action diagram.

  9. The completed action diagram should look like the example below:

    Set Exits

  10. Close the diagram and save your model.