search |

Lineage was created to allow retrieval of any or all related assets with a single, simple query to the database. This means we can retrieve all ancestors, parents, siblings, children, and descendants as well as know the ranks of all within a group of siblings.

The WebGUI lineage system stores all this information in a 6 digit number padded by zeros at the front and starting with the number 1.

Example lineage:

*000001000005000028000002000009*

From this lineage we can gather the following information quickly and easily:

**What generation is the current asset?** *Five, because there are five sets of six numbers. *

**What is the lineage of this asset's parent?** *000001000005000028000002,because we simply subtract the last six digits off the end of the lineage, and we have the parent's lineage.*

**What is the lineage of this asset's grandparent? ***000001000005000028, using the same mechanism we used to find the parent. *

**What is the lineage of the first or root asset?*** 000001. It must always be 000001 due to the definition of lineage. *

**How can I find the children of this asset?** Get a list of assets that have a lineage that begins with* 000001000005000028000002000009* and have a lineage length of 6.

**How can I find the siblings of this asset? **Get a list of the assets which have a lineage that begins with* 000001000005000028000002* and have a lineage length of 5, and that does not have a lineage of *000001000005000028000002000009*.

**What is the rank of this asset?** *9, because the last set is 000009, and we can remove the padding to get 9.*

**What is the rank of this asset's granparent?** *28. First find the grand parent, and then find the rank.*

Keywords: api Assets Development lineage