Previous Topic: Perform View MaintenanceNext Topic: Set Exit States


Add Action Diagram Statements

Follow these steps:

  1. Now, we want to add the read statement. Select the blank line in the action diagram. From the Menu Bar select Edit, select Add Statement, and then select Read…
  2. In the Add Statement dialog, the golfer was already selected for us, since that was the only entity action view we had. Select the Qualify push button. We want to qualify the golfer based on the attribute user ID.
  3. Select attribute view, then DESIRED persistent view (the golfer gets automatically filled in), then userid, then IS EQUAL TO, then character view, then transient view, then import golfer, then userid, and finally select the Add push button to add the statement to the diagram.
  4. For the WHEN not found condition, set the exit state to the exit-state-value GOLFER NF. See the previous action diagram instructions if you need help.
  5. 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….
  6. From the choices provided in the bottom panel of the Add Statement dialog, select attribute view, then golfer, then password, then IS EQUAL TO, then character view, then import golfer, then password, and finally select the Add push button to add the statement to the action diagram.
  7. 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….
  8. From the choices provided in the bottom panel of the Add Statement dialog, 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 can select the Undo push button and make a different selection.
  9. Select the Add push button to add the statement to the action diagram.
  10. If the passwords do not match, then we want to set an appropriate exit-state-value. After 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.

  11. To set the exit state, from the Tool Palette select Exit State, and then (with the crosshairs) select the ELSE statement. If necessary, in the Exit State Selection list, expand the <Global Exit States>.

    There is not an appropriate exit-state-value value available, so we will need to create a new one.

  12. Select <Global Exit States>, then select the Add… push button. 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. Re-enter your password. Then select the OK push button to add it to the list. If multiple adds is turned on, select the Cancel push button to close the (new object) Properties dialog. The new exit-state-value should be highlighted. Select the Select push button to select it and then select the Add push button to add the statement to the action diagram.

    The completed action diagram should look like the following example:

    Set Exit States

  13. Close the diagram and save your model.