Children fields

Children fields are a special feature of the schema designer/data hub. Children fields allow you to define the relationship between a parent record (for example, an order), and child records that depend on the parent for their existence (for example, an order line). You can then pass the a parent record along with its children (for example, an order plus its order lines) into the consolidation engine as a single message, and the consolidation engine will use the children definition to populate both tables.

The children processing is very powerful. It can:

  • Automatically delete "orphaned" children.
  • Add sequence numbers to the child rows.
  • Have children inside children, and so on.

To create a children relationship, you need to:

  • Create a link field on the child record. (You don't have to create a link field - any text field of length 36 will do - but it is the easiest way).
  • If you want the children processing to automatically maintain a sequence number for the children, define an integer field for the sequence number and add this to the child.
  • Include the link field and the sequence number (if any) in the key of the child entity. If you don't include a sequence number, you must specify as keys another field or fields that can uniquely identify a child within the parent.
  • Create a field of type children (either using the Field type and selecting children, or using the Children field type).
  • On the children field:
    • Use the Child entity drop-down to select the child entity type.
    • Use the Parent identifier drop-down to select the link field on the child entity that links to the parent.
    • Use the Child sequence drop-down to select the sequence number field (if used).
  • Add the children field to the parent entity.