You can add C++ code to a capsule-based UML model by inserting
code into the Code View editor, a built-in snippet editor, or an external
editor of your choice.
Adding code to model elements in capsule-based diagrams
As you work with capsule-based diagrams, you might choose
to add code to or edit the code for UML model elements by using the Code View editor. In some cases, the Code View allows you to select one element in order to provide support for
a collection of other associated elements. For example, selecting
a Class provides access to all class operations,
or selecting a Choice Point or Junction
Point provides access to the guards of any of the outgoing
transitions.
Fixing errors in C++ code for capsule-based models
When you compile the C++ code for a capsule-based UML model,
any errors that occur are displayed in the Problems view.
You can open the error to show it in the diagram editor, and you can
fix the error in the Code View editor.
Synchronizing C++ code in capsule-based UML models
You can synchronize any changes that you make to the code
with your capsule-based model. When you change the generated source
and save it, the system synchronizes the generated source with the
model snippets. A dialog box shows all the changes, and you can commit
the changes to the model.