Using the rel Subtag

The <rel> subtag represents a relationship in the object model repository. Attributes are:

The <target> and <source> subtags represent, respectively, the right and left ends of the relationship. These subtags are equivalent in function and syntax to the <entity> tag. Use the <cond> subtag to specify a condition.

Note: As a practical matter, you will almost never have occasion to use the <entity> subtag.

If the <rel> subtag is specified at the top level of the entry, and no <source> tag is specified, the parser creates the relationship with the calling program; otherwise, it creates the relationship between the <source> and <target> entities. If the <rel> subtag is nested in an entity specification, the parser creates the relationship with the parent entity.

Example

Assume that we know that the second parameter in the API call described earlier for the <vars> tag contains a variable in bytes 1-3 that specifies the CRUD operation, in addition to the variable in bytes 6-8 specifying the table name. The following definition extracts the CRUD operation and table name:

<vars>
  <arg var='%OpName'
       param='2'
       type='data'
       offset='0'
       size='3'/>
  <arg var='TableName'
       param='2'
       type='auto'
       offset='5'
       size='3'/>
</vars>
<rep>
  <rel>
    <target type='TABLE'
            name='%TableName'/>
    <name switch-var='%OpName'>
      <case eq='RED' value='ReadsTable'/>
      <case eq='UPD' value='UpdatesTable'/>
      <case eq='ADD' value='InsertsTable'/>
      <case eq='DEL' value='DeletesTable'/>
    </name>
  </rel>
</rep>