This sample takes approximately 2 minutes to import and configure.
The sample describes a complete UML design model that you can import and view,
and then transform into working C# code.
Before you begin
To run the UML-to-C# transformation, you must have Microsoft Visual
Studio 2005 installed and the target solution must be open . Open Visual Studio
before opening your Eclipse IDE.
Before you can transform your model to
code, you must create a Visual Studio solution and transformation configuration.
The solution you create is the target location for the generated C# code
About this task
To create a transformation configuration and run the transformation:
Procedure
- Create a Visual Studio .NET solution:
- In Visual Studio 2005, click .
- Select a Visual C# project type. For example, expand Visual
C# > Windows and then select Empty Project.
- Type a name for the project.
- Click OK.
- Create a transformation configuration:
- In a Rational® UML Modeling product, click .
If Transformation Configuration is not a menu item, click .
- In the New Transformation Configuration window,
in the Name field, specify a name for the configuration.
- From the Forward transformation list,
select UML to C# transformation.
- Specify the destination for the transformation configuration
file. The destination is a relative path in your current workspace. You can
specify a fully qualified project name or folder name. If you specify a folder
in a project, you must prefix the folder name with a slash (/).
- Click Next and then click Create
New Target Container.
- In the .NET solution window, click Browse and
specify the location of your .NET solution.
Note: To create
your target project, Microsoft Visual Studio .Net must
be open.
- Click Finish.
Results
You have completed the transformation configuration that contains
the information required to generate the correct output. To run the transformation,
expand
IBM Rational Transformations, right-click the
transformation configuration (.tc) file you created; then click
Transform and
click the transformation to run.
What to do next
After you run the transformation, you can view the generated C# source
by opening the .NET solution that you specified as the target project.