Chapter 4 Extending your Models with Profiles


Criteria (Profile)

You can control the treatment of metaclass instances based on whether they conform to one or more criteria. Whereas you can apply only one stereotype to a metaclass instance, you can test the instance against multiple forms of criteria.

You define one or several criteria for a selected metaclass. Criteria let you define the same extensions as stereotypes.

When a metaclass instance meets the criterion condition, the extensions defined on the criterion are applied to this instance. In case of sub-criteria, both the criterion and sub-criterion conditions must be met for the relevant extensions to be applied to the instance.

Steps To create a criterion:

  1. Right-click a metaclass and select New→Criterion in the contextual menu.

    A new criterion is created with a default name.
  2. Modify the default name in the Name box, and type a condition in Condition box. You can use any valid expression used by the .if macro (see "Using macros" in the Generation Reference Guide chapter) but you should not type the macro itself.
  3. Click Apply to save your changes.

 


Copyright (C) 2008. Sybase Inc. All rights reserved.