A Root function is a specific type of Fabric function that is used as a Source Object to trigger the Table Population mechanism. There are two types of Source Objects for a Table Population object:
A Root function is used when a Table Population requires complex logic. For example, when a population requires data from multiple DB interfaces or non-DB interfaces.
Click for more information about using Root Functions in a Population.
There are several ways to create a Root function:
The steps for creating a Root Function in Fabric Studio are the same as those for a regular function. Set the Function Type to Root Function. It is recommended to include all Root functions under one category file named Root.
Click for more information about How to Create a Project Function.
A Root function must have at least one Input parameter and at least one Output parameter. The Input parameter connects the Root function of an LU with its parent object in the LU schema. The Root Table in an LU schema is always populated by the Instance ID. The Output of a Root function serves as Input for the Table Population. A Root function must have a yield() command to return the array of Objects (with the type Object []). All records yielded from the function are inserted into the target table. The Input and Output parameters can be added to the function automatically using the Objects / Database pane in the Function Manager window.
Example of the Input and Output Parameters Settings
The Root function’s main SELECT statement and loop over the SELECT results can be automatically generated to act as the basis for a function.
Example of the Generated Code of a Root Function
String sql = "SELECT SSN, FIRST_NAME, LAST_NAME FROM CUSTOMER";
db("CRM_DB").fetch(sql, [val1], [val2], ...).each(row->{
yield(row.cells());
});
The Root function should be edited as follows:
Example of the Edited Code of a Root Function
String sql =
"SELECT SSN, FIRST_NAME, LAST_NAME FROM CUSTOMER WHERE CUSTOMER_ID = ?";
db("CRM_DB").fetch(sql, i_customer_id).each(row->{
//do something
yield(row.cells());
}
Click to go to the Root Function’s Code Example.
Note that if a deleted Root function is used by a population, update the population to include a different source object.
A Root function is a specific type of Fabric function that is used as a Source Object to trigger the Table Population mechanism. There are two types of Source Objects for a Table Population object:
A Root function is used when a Table Population requires complex logic. For example, when a population requires data from multiple DB interfaces or non-DB interfaces.
Click for more information about using Root Functions in a Population.
There are several ways to create a Root function:
The steps for creating a Root Function in Fabric Studio are the same as those for a regular function. Set the Function Type to Root Function. It is recommended to include all Root functions under one category file named Root.
Click for more information about How to Create a Project Function.
A Root function must have at least one Input parameter and at least one Output parameter. The Input parameter connects the Root function of an LU with its parent object in the LU schema. The Root Table in an LU schema is always populated by the Instance ID. The Output of a Root function serves as Input for the Table Population. A Root function must have a yield() command to return the array of Objects (with the type Object []). All records yielded from the function are inserted into the target table. The Input and Output parameters can be added to the function automatically using the Objects / Database pane in the Function Manager window.
Example of the Input and Output Parameters Settings
The Root function’s main SELECT statement and loop over the SELECT results can be automatically generated to act as the basis for a function.
Example of the Generated Code of a Root Function
String sql = "SELECT SSN, FIRST_NAME, LAST_NAME FROM CUSTOMER";
db("CRM_DB").fetch(sql, [val1], [val2], ...).each(row->{
yield(row.cells());
});
The Root function should be edited as follows:
Example of the Edited Code of a Root Function
String sql =
"SELECT SSN, FIRST_NAME, LAST_NAME FROM CUSTOMER WHERE CUSTOMER_ID = ?";
db("CRM_DB").fetch(sql, i_customer_id).each(row->{
//do something
yield(row.cells());
}
Click to go to the Root Function’s Code Example.
Note that if a deleted Root function is used by a population, update the population to include a different source object.