Variables

Variables are basic expressions. A variable name is an expression that evaluates to the value bound to that variable. For example, if x is bound to the expression 5 + 6, then x ⇒ 11 and x + 2 ⇒ 13. There are three predefined variables that pervade every program. These are model, this, and current, all type object.

Predefined variable: model

The variable model is bound to the unique instance of the metaclass Model that represents a model in IBM® Rational® Rhapsody® ReporterPLUS. All data in a model is ultimately reachable from the Model instance bound to model.

Predefined variable: this

The variable this is bound to the actual parameter of a Q program. Every program inRational Rhapsody ReporterPLUS is applied to some instance of a metaclass. For example, an advanced condition in the condition tab is applied successively to the metaclass instances in the association being iterated over. For each application, this is bound to the current instance in the iteration.

Predefined variable: current

Unlike the other predefined variables, the variable current is able to bound to different values at different textual locations in a program. Specifically, current is bound to whatever metaclass instance is "current" at any given textual location. At the outermost expression, for example, the "current" metaclass instance is the parameter to the whole program. Therefore, current is bound to the same object as this at the outermost expression. There are several expressions that temporarily rebind current. We make note of this fact in the descriptions of such expressions in the remainder of this document.


Feedback