| Transformation | Description |
|---|---|
| Class-to-Text > Console | This transformation accepts a Unified Modeling Language (UML) class as its source and writes a description of the class which includes the name of the class and its attributes and operations, and the parameters of the operations, to the Console view. |
| Class-to-Text > File | This transformation is the same as the Class-to-Text Console transformation, but it writes the results to a file instead of the Console view. |
| State-to-JSP | This transformation accepts a state machine as its source and generates a JavaServer Pages (JSP) page for each state that has a stereotype from the ScreenFlow profile. |
This sample transformation shows you how to do the following things:
To prepare the source state machine for the transformation, you must apply the ScreenFlow profile to the UML model that contains the state machine and mark up the state machine by applying the stereotypes in ScreenFlow profile to its states. The ScreenFlow profile contains four stereotypes: form, editform, selectlist, and display. These stereotypes determine the display style of the dynamic contents of the generated page. The sample uses the stereotypes to determine whether the display style is an editable form or a selectable list, and so on. If you apply more than one stereotype to a state, the transformation only considers the first stereotype.
The sample also uses the properties of the stereotypes to determine the data that is exchanged through the JSP pages. The transformation generates a JSP page that corresponds to a state only if one of the four stereotypes is applied to the state. If the JSP files already exist, the transformation does not overwrite them when it runs. You can change whether the transformation overwrites files by setting the value of the transformation property, Overwrite Output Files, to true.
ScreenFlow Profile
The following table shows the stereotypes in the ScreenFlow profile and their properties. The values in the table are for illustration purposes only.
| Stereotype | Base Class | Properties:Values | Description |
|---|---|---|---|
| «display» | State | entity:Contact fields:name, address | Indicates that the generated JSP page displays the contact details: name and address |
| «editform» | State | entity:Contact fields:name, address | Indicates that the generated JSP page contains an editable form in which a user can enter or edit contact details: name and address |
| «form» | State | fields:userName | Indicates that the generated JSP page contains a form to enter the user's name |
| «selectlist» | State | entity:Contact fields:name, address selectfield:id | Indicates that the generated JSP page contains a list of contacts that can be used to select a contact with a specific ID |