_TO_RELATIONSHIP

The _TO_RELATIONSHIP (or _TO_REL) element instructs the connector to find relationships from business objects to the current object. The current object is the last business object in the Enovia repository that was retrieved based on elements further up the DocumentsXML XML hierarchy.

The _TO_RELATIONSHIP element does not insert any metadata into the document, but child elements can be used to insert information about the relationships and related objects.

The relationships to the current object can be filtered based on the type of the relationship and the type of the related object.

Attribute Description
relationship_pattern (or rel_pattern)

A comma-separated list of strings to restrict the types of relationships that are retrieved. Only relationships with a type matching one or more of the strings are retrieved.

The wildcards * and ? can be used.

type_pattern

A comma-separated list of type names. Only relationships from business objects with a type matching one or more of the names are retrieved.

The wildcards * and ? can be used.

node_name The name of the metadata field that is created for each relationship. If node_name is not specified the child metadata is added at the current depth in the document metadata. This attribute only adds structure to the metadata and does not affect the metadata itself.
obj_where A string to restrict the relationships that are retrieved, based on the properties of the related object. Type a string using the query language used by Enovia.
rel_where A string to restrict the relationships that are retrieved, based on the properties of the relationship. Type a string using the query language used by Enovia.
Other attributes Other attributes that are not reserved are output as metadata in the resulting document.

Example

The following examples result in identical output. The first example uses the node_name attribute.

<DOCUMENT ...>
   <mydoc>
      <_TO_REL rel_pattern="Manufacturing Responsibility" type_pattern="Manufacturer" node_name="responsibility" myfield="value">
       ...
      </_TO_REL>
      <attributes>
       ...
      </attributes>
   </mydoc>
</DOCUMENT>

The following example does not use the node_name attribute:

<DOCUMENT ...>
   <mydoc>
      <_TO_REL rel_pattern="Manufacturing Responsibility" type_pattern="Manufacturer">
        <responsibility>
          <myfield>value</myfield>
           ...
        </responsibility>
      </_TO_REL>

      <attributes>
       ...
      </attributes>
   </mydoc>
</DOCUMENT>

Result

The following XML metadata is created in the indexed document. A responsibility element is created for each matching relationship:

<mydoc>
   <responsibility>
      <myfield>value</myfield>
      ...
   </responsibility>
   <responsibility>
      <myfield>value</myfield>
      ...
   </responsibility>
   ...
   <attributes>
      ...
   </attributes>
</mydoc>

_HP_HTML5_bannerTitle.htm