Add Page Variable to State Machine
This page provides directions to add the
timecardSummaries
page variable
to the
Search Timecards
state machine.
- Right click on the transition out of
Search Timecards
and chooseAdd UML
> Attribute. It will create an Activity as the effect of the transition.
- 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).
- Right click on the newly created activity (in the model explorer) and open its properties.
- Click on the
ImportPackage
tab.
- Click on the button on the right to add a package import. Select the
timetracker
model
and click onOK.
- Click on the
Parameters
tab.
- 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.
- 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.