Add Page Variable to State Machine

This page provides directions to add the timecardSummaries page variable to the Search Timecards state machine.

  1. Right click on the transition out of Search Timecards and chooseAdd UML > Attribute. It will create an Activity as the effect of the transition.
  2. Rename it as blank - this is the only difference between modeling an event (coming out of a view) and a page variable (entering in a view).
  3. Right click on the newly created activity (in the model explorer) and open its properties.
  4. Click on the ImportPackage tab.
  5. Click on the button on the right to add a package import. Select the timetracker model and click onOK.
  6. Click on the Parameters tab.
  7. Click on the button on the right (the one with a red circle) to add a parameter. Enter timecardSummaries as the name of the parameter and choose TimecardSummaryVO[] as its type.
  8. Select the timecardSummaries parameter and apply it the andromda_presentation_view_table_columns stereotype. This tagged value tells AndroMDA to render the page variable as a table. Open the in the Stereotype tab and on the ... button in the right of andromda_presentation_view_table_columns. Enter the following values in the dialog, by clicking on the Insert new String button:
    • id
    • submitterName
    • approverName
    • status
    • startDate
    This tells AndroMDA to display 5 columns in the table corresponding to the 5 attributes of TimecardSummaryVO. Click onClose. (Note that the TimeTracker prototype does not have an Id column in the results table. However, we add it here so that the id is available to each row.)

We have now added the timecardSummaries page variable to the Search Timecards state machine. Please go back to the main tutorial page and continue from where you left off.