Explicit Relationship Using the CONTAINS Attribute

An Explicit relationship allows you to relate records within a repository. The relation between the records is achieved using the CONTAINS attribute. Every repository has a predefined attribute called CONTAINS, which is defined as a String. The attribute cannot be manipulated using the user interface. The CONTAINS attribute is used only during the Import process. It is used to manage relationships with child records, not with parent records.

Warning: The record operations such as search based on CONTAINS is not supported. For best results, the use of the CONTAINS attribute should be limited to the DELETE and DELETEALL commands to manage relationships.
Restriction: While importing records, if you use contains column to delete relationships and the value of the VersionPolicy parameter is selected as Correct or Optimize, then delete takes precedence and deletes the relationship even if is a part of the current import.

While creating a data source, you can have a column with the CONTAINS attribute that can be mapped to the CONTAINS attribute of the repository.For example, you can have a data source with PRODUCTID, PRODUCTEXT, PRODUCTDESC, and CONTAINS columns. The following is a list of sample values retrieved by these columns:

  • PRODUCTID : PO1
  • PRODUCTEXT: P11
  • PRODUCTDESC: The model number for this product is PZ123.
  • CONTAINS: B02:B11:1:121:Delete

The value entered in the CONTAINS column is called a relationship entry. Every record in a data source becomes a parent record, and the relationship entry defined in the CONTAINS attribute denotes the kind of relationship a parent record establishes with the child record.

A Sample Data Source File

The syntax for CONTAINS column is as follows:

ID:EXT:QTY:TYPE:COMMAND

Where,

ID: Product ID of the child record.

EXT: Product ID extension of the child record.

QTY: (Optional) Quantity of child included in the parent record. The value must be a positive integer greater than 0. The default value for this field is 1.

TYPE: (Optional) Relationship type. Either the name of the relationship or the type (integer) can be specified. The integer entered here should be the same as that entered for TYPE in the Relationship definition. The default value for this field is 1. If TYPE is specified, QTY must also be specified.

COMMAND : If you leave this blank, the relationship entry gets added to the database. If the COMMAND is specified, TYPE must be specified. The following commands can be specified:

DELETE : If the relationship to a child record exists, it should be deleted.

DELETEALL: All relationships of a specified TYPE should be deleted. When this command is entered, ID and EXT can be 0 to ensure that they are ignored.

You can specify more than one relationship entry in the CONTAINS attribute separated by a comma. If the data contains multiple commas following each other, the comma is treated as a part of the record (not treated as a separator). The data must be enclosed in double quotation marks.