7 7 2 Change a Relationship

Visual LANSA Logical Modeler

7.7.2 Change a Relationship

To change a relationship's details, select its shape on the diagram and:

  • select the Change… command from its right-click menu, or
  • select the Change… command from the Edit menu, or
  • click the button on the toolbar.

The Change Relationship dialog is displayed:

The type of the relationship may not be changed. If the type of relationship is incorrect between the two entities, it should be deleted and an appropriate relationship created.

If applicable, the sharing of identifying elements with the target entity can be enabled or disabled by checking or unchecking Share inherited identifiers. Refer to 1.1.10 Understanding Shared Keys.

Source and Target Descriptors are optionally used to describe the relationship between the two entities from both directions. They are defaulted according to the type of relationship being created, but can be blanked out or overridden with more meaningful descriptions. They serve two functions:

  • On the model diagram, the relationship connector, once created, will contain the Source to Target description entered here, followed by the Computer Prefix in brackets if one has been specified.
  • Descriptions of logical views, access routes and referential integrity validation rules created in the repository will use the text specified here.

A computer prefix is optional at all times. If specified, it is appended to the start of the element names which are inherited as a result of the relationship. Using a Descriptive prefix helps in making the element and resultant field visually unique, as its description is a combination of the computer prefix and the name of the inherited element(s).

Consider this example of descriptive prefix use:

  • The Customer entity has two include relationships with the Address entity: one for delivery address, and one for billing address.
  • The descriptive prefix for the first relationship is specified as Delivery. If the Address entity has an element called Zip Code, the field generated in the repository will have a description of Delivery Zip Code.
  • The descriptive prefix for the second relationship is specified as Billing. If the Address entity has an element called Zip Code, the field generated in the repository will have a description of Billing Zip Code.

A Logical View Name may be specified if the relationship being changed is a join relationship, or if the relationship is a second or subsequent parent/child relationship.  Note that only parent/child relationships subsequent to the first will generate logical views.  If the sequence of multiple parent/child relationships is changed within the affected entity, logical view names that have been previously specified may be reset, because the first parent/child relationship will not generate a logical view.  If this reset occurs, the logical view name(s) of parent/child relationships subsequent to the first must be re-specified.

Note that, if a physical file name of greater than the maximum number of characters allowed (10 if the *RPGIV setting is enabled in your system, 8 if it is not) has been specified for the source entity, a logical view name must be specified before the source entity will successfully build.  If, however, a physical file name has been specified that is less than the maximum allowed by two or more characters has been specified, the logical view name is optional.  In this instance, the modeler will automatically create a logical view name when the entity is built.  This view name will be based on the source entity's physical file and a sequential two digit number.

Note also that if an entity inherits the same element multiple times (as with the example above), the field names for the inherited elements must be unique within the inheriting entity. Refer to 6.4.2 Change an Element.

Press the OK button to change the relationship. Once validation has been completed, the build status of the entities affected by the relationship will be updated and the relationship shape will be updated appropriately on the diagram.

Press the Cancel button if you do not wish to change the relationship.