Generating Code for Actors Selecting Actors Within a Component Classes have code generation properties that determine whether Rational Rhapsody should generate code for relations and dependencies between actors and classes. To select code generation for actors within a component: 1. Right-click the component in the browser and then select Features . 2. Select the Initialization tab. 3. Under Initial Instances , select the actors to participate in the component. 4. Make sure Generate Code for Actors is selected. Generate Code for Actors is selected by default, but is cleared when loading pre-version 3.0 models to maintain backward compatibility.
By default, relations between actors and classes are generated only if the actor is generated. You can fine-tune this within the class by using the CG::Relation::GenerateRelationWithActors property. See the definition provided for the property on the applicable Properties tab of the Features window. Limitations on Actor Characteristics There are limitations on how actors can be created, which affect code generation. These limitations are as follows: Љ An actor cannot be specified as a composite in an OMD. Therefore, Rational Rhapsody does not generate code that initializes relationships among its components. Љ The base of an actor must be another actor.
The base of a class must be another class. Љ An actor can embed only nested actors. A class can embed only nested classes. Љ The name of an actor does not have to conform to code standards for a class name. But if an actor name is illegal (that is, it does not have a name that can be compiled) an error is generated during code generation. Rational Rhapsody 927