🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Cross Reference and Rename
This page was created by Wikiadmin on 2026-07-29. Last edited by Wikiadmin on 2026-07-29.

You can use Cross Reference and Rename in MDriven Designer to find model usages and update supported references when you rename an attribute, class, or association end.

Cross Reference

Cross Reference lists the places where a selected model element is used. Use it before you change a name to understand which OCL expressions and ViewModel definitions depend on that element.

For example, select the RegistrationNumber attribute and open Changed by - Cross Reference. The result can show a ViewModel column such as ProperCarView.RegistrationNumber R/W and a report ViewModel that also uses the attribute. You can open each result and update its expression or UI setting.

Cross Reference is useful for inspection. It does not by itself update usages.

Rename a model element

Use Rename rather than editing the name directly when the element is already referenced in expressions or ViewModels. Rename finds usages of the selected name and lets you choose which usages to update.

  1. In MDriven Designer, select the attribute, class, or association end that you want to rename.
  2. Right-click the element and choose Rename.
  3. Enter the new name.
  4. Review the listed usages. The dialog identifies the expression type, for example a ViewModel expression or an attribute derivation expression.
  5. Keep the checkbox selected for each usage that you want Rename to update.
  6. Select Set Former Name when the renamed element is persisted in a database and existing data must be retained.
  7. Click Apply.
  8. Reindex the model and resolve any remaining errors.

For example, renaming an attribute from Name to NameX with all usage checkboxes selected updates the supported references that use Name. Reindexing should then show no errors caused by the renamed reference.

Choose which usages to update

The Rename dialog lets you apply the new name selectively.

Choice Result
Keep a usage selected Rename updates that listed usage.
Clear a usage checkbox Rename does not update that usage. You must update it manually if it should use the new name.
Clear all usage checkboxes Only the selected element is renamed. This has the same reference impact as editing its name directly.

For example, if an attribute is named RegistrationNumber and an OCL expression contains self.RegistrationNumber, clearing that expression's checkbox leaves the expression unchanged. After the attribute is renamed, the expression can produce a reindex error until you change it to the new name.

Preserve database data with FormerNames

FormerNames records the previous persisted name of an element. Select Set Former Name during Rename when a renamed attribute, association end, table-related element, column, or foreign key already has data in the database.

During database evolution, FormerNames enables the database evolution process to move existing data from the old name to the new name instead of treating the change as a drop-and-create operation.

For example, if an association end named BrandOfCar is renamed to BrandOfCarX, setting its former name to BrandOfCar tells evolution that the old persisted name maps to the new one. Without this information, a rename can result in a new database structure and loss of data stored under the old name.

If your application currently stores data only as XML and has no database backing, setting a former name is not needed for that storage change.

Reindex after renaming

Reindex after every rename. Reindex checks the model and exposes expressions that still use the old name.

Rename updates the usages it can identify, but you must verify the result. In particular, review OCL expressions with similar association names and confirm that each navigation refers to the intended association end. If reindex reports errors, open each error, correct the remaining old reference, and reindex again.

Supported elements

Rename supports attributes, classes, and association ends. Use Cross Reference to inspect dependencies for the element before and after the change.

See also