Modify Relationship

After a business object relationship is defined, you can change the definition with the Modify Relationship command. This command lets you add or remove defining clauses and change the value of clause arguments.

This page discusses:

Syntax

modify relationship NAME [MOD_ITEM {MOD_ITEM}];
  • NAME is the name of the relationship you want to modify.
  • MOD_ITEM is the type of modification you want to make. You only need to specify fields to be modified.
    Modify Relationship Clause Specifies
    name NAME The current relationship name is changed to that of the new name.
    add attribute NAME The attribute listed here is associated with this relationship.
    remove attribute NAME The attribute listed here is removed from the relationship.
    description VALUE The current description, if any, is changed to the value entered.
    add trigger EVENT_TYPE TRIGGER_TYPE PROGNAME The specified trigger is added or modified for the listed event.
    remove trigger EVENT_TYPE TRIGGER_TYPE The specified trigger type is removed from the listed event.
    icon FILENAME The image is changed to the new image in the field specified.
    from MOD_SUB_ITEM {,MOD_SUB_ITEM} A modification to the from connection end is made. This modification can involve altering the types of objects used by the relationship and/or how the relationship should be maintained if there is a revision to an object instance. For more information, see Connection End Modifications.
    to MOD_SUB_ITEM {,MOD_SUB_ITEM} A modification to the to connection end is made. This modification can involve altering the types of objects used by the relationship and/or how the relationship should be maintained if there is a revision to an object instance. For more information, see Connection End Modifications.
    add rule NAME The specified access rule is added. If you modify the rule for a derived relationship, the new rule overrides the parent's rule. Only one rule can be defined for a derived relationship. If no rule is defined, the parent's rule governs the relationship.
    remove rule NAME The specified access rule is removed
    add composeeaccess MASK composeeaccess is added with the specified MASK, which is a comma-separated list of any valid access masks, such as show,read,... is added.
    remove composeeaccess composeeaccess is removed from the relationship.
    preventduplicates The preventduplicates flag is changed so that duplicate relationship types are not allowed.
    notpreventduplicates The preventduplicates flag is changed so that duplicate relationship types are allowed.
    derived RELATIONSHIP_NAME The relationship being modified inherits attributes, methods, triggers, governing rules, and allowed from and to end business types of the relationship named.
    abstract true Connection instances of this relationship cannot be created.
    abstract false Connection instances of this relationship can be created.
    hidden The hidden option is changed to specify that the object is hidden.
    nothidden The hidden option is changed to specify that the object is not hidden.
    property NAME [to ADMINTYPE NAME] [value STRING] The named property is modified.
    add property NAME [to ADMINTYPE NAME] [value STRING] The named property is added.
    remove property NAME [to ADMINTYPE NAME] [value STRING] The named property is removed.
    history STRING Adds a history record marked "custom" to the program that is being modified. The STRING argument is a free-text string that allows you to enter some information describing the nature of the modification. For more information, see Adding History to Administrative Objects.

Each modification clause is related to the clauses and arguments that define the relationship. When you modify a business object relationship, you first name the relationship to be changed and then list the modifications. For example, to change the name of the Alternative relationship and add an attribute and a trigger, you might write this command:

modify relationship Alternative
   name "Component Alternative"
   add attribute "Cost Comparison"
   add trigger create check "Cost Check"
   add trigger create override "Use Alternate Relationship"
   add trigger create action "Notify John";

Connection End Modifications

When you are modifying the connection ends of the relationship, the MOD_SUB_ITEM clause is similar to the clauses used to define the end objects.

Connection End Modification Clause Specifies
add type all All defined types are allowed to be associated with this relationship end.
add type TYPE_NAME {,TYPE_NAME} The object types listed here are allowed to be associated with this relationship end.
add relationsip TYPE_NAME {,TYPE_NAME} The relationships listed here are allowed to be associated with this relationship end.
remove type all All object types are removed from this relationship end.
remove type TYPE_NAME {,TYPE_NAME} The object types listed here are removed from this relationship.
remove relationsip TYPE_NAME {,TYPE_NAME} The relationships listed here are removed from this relationship.
meaning VALUE The current meaning, if any, changes to the value entered.
cardinality CARDINAL_ID The value for cardinality is set to the value entered.
revision REVISION_RULE The revision rule changes to the value entered.
clone CLONE_RULE The clone rule changes to the value entered.
propagatemodify The modification timestamp of the object on the specified end will be updated when the relationship's attribute values are modified.
[!|not]propagatemodify The object's modification timestamp on the specified end will not be updated when the relationship's attribute values are modified.
propagateconnection The object's modification timestamp on the specified end will be updated during connect/disconnect operations.
[!|not]propagateconnection The object's modification timestamp on the specified end will not be updated during connect/disconnect operations.

These clauses are used within the To and From clauses as they are used in the Add Relationship command. Assume you have the following definition:

add relationship Comment
   description “Associates comment with related object”
   from
     type Comment
     meaning “Provides comment about ”
     cardinality n
     minorrevision none
     clone none
     propagatemodify
     !propagateconnection
   to
     type Assembly, Document, Specification, Layout
     meaning “Is commented in ”
     cardinality n
     minorrevision none
     clone none
     propagatemodify
     !propagateconnection;

To this definition, you might want to add a new object type that can connect to Comment objects, and you want objects on the FROM end to propagate modifications of the relationship to the business object. You also want to save all revised comments and include them in all revisions with the commented object. To make these changes, you might write the following Modify Relationship command:

modify relationship Comment
   to
     minorrevision replicate
   from
     add type “Process Plan” propagatemodify;

When this command is processed, the definition for the Comment relationship appears as:

relationship Comment
   description "Associates comment with related object"
   from
     type Comment
     meaning "Provides comment about"
     cardinality n
     minorrevision replicate
     clone none
     propagatemodify
   to
     type Assembly, Document, Specification, Layout, Process Plan
     meaning "Is commented in"
     cardinality n
     minorrevision none
     clone none;