A TDM task copies a Business Entity (BE) from a source environment to a target environment. A BE can have multiple LUs with a flat or a hierarchical structure. For example, a Customer BE can consist of Customer Care, Billing, Ordering and Usage LUs. The ability to break a BE up into several LUs enables maximum flexibility and avoiding duplicate development. In addition, defining a hierarchical structure of parent-child LUs enables creating LUs based on the natural root entity of the related data sources instead of forcefully setting unified root entities on all LUs related to a given BE.
Each LU in a TDM project must have additional components to support TDM functionality, as described below:
Each LU in a TDM project has the following structure:
Dummy root table: FABRIC_TDM_ROOT.
Generic TDM LU tables that are linked to the root table.
Two main branches that are linked to the root table :
Source branch: LU tables that extract an entity's source data. Source LU tables are populated when a TDM task needs to load (insert) entities to a target environment and therefore must extract the source data of these entities.
Target branch: LU tables that extract the target keys of an entity. The keys are extracted from the target environment to enable deleting an entity from a target environment if required by the TDM task.
Click for more information about Fabric implementation and deleting entities from the target environment.
Import the TDM_LIBRARY LU from the TDM Library to your project and copy the LU level objects in the TDM_LIBRARY to your LU.
Click for more information about supporting hierarchy in the TDM implementation.
Link the main source LU tables to the FABRIC_TDM_ROOT table. The main source table represents the main (root) table in the data source. For example, the Customer table is the main source LU table of Customer LU.
Verify that the one of main source LU table is also populated in ROOT_TABLE_NAME and ROOT_COLUMN_NAME Globals.
Create the population of the main source LU tables based on the Root function. The generated root function contains the output fields and the select query on the source table.
Edit the Root functions generated for the LU tables based on the fnPop_RootTable function under the TDM_LIBRARY LU:
Copy the code of the fnPop_RootTable into the newly generated Root function of the LU table.
Add the following import to the root function:
This import is needed since the root function defines the instanceExists indicator as AtomicBoolean. Note that this indicator cannot be defined as a Boolean since it is set inside the Lambda expression in the loop on the ResultSet.
Edit the String sql variable to include the DB query on the DB table.
Edit the db parameter of the fetch command.
String sql = "SELECT CUSTOMER_ID, SSN, FIRST_NAME, LAST_NAME FROM main.CUSTOMER where customer_id = ?";
db("CRM_DB").fetch(sql, input).each(row->{
yield(row.cells());
});
The updated Root function populates the main source LU table under the following conditions:
Click to view the Override Sync Mode Summary Table.
As a result, if the Sync mode is set to Do not sync by the user, or the task is a delete only task, the source LU tables are not populated by the LUI sync.
This function also validates if the entity exists in the source table. If the entity is not found in the main source tables, this function throws an Exception and the entity is rejected.
See example of a root function that populates Customer LU table:
Link the remaining source LU tables to the main LU tables so that if the main source LU table is not populated, the remaining source LU tables also remain empty.
Mask sensitive data in LU tables using a Broadway population and the Masking Actor.
Click for more information about TDM Masking.
Edit trnLuParams and LU_PARAMS to enable a subset of entities from selected parameters for this LU.
Click for more information about Handling TDM Parameters.
Define the LU tables to extract the target keys to enable deleting an entity from the target.
Link the main target LU table to the FABRIC_TDM_ROOT table.
Add the fnDecisionDeleteFromTarget Decision function to all target LU tables. Note that this Decision function is under Shared Objects and is imported from the TDM Library.
Create the population of the main target LU table based on a Broadway flow. The Broadway flow must set the task's target environment to be the active environment in order to select the target IDs from the target environment.
Link the remaining target LU tables to the main target LU table.
Click for more information about the deleting entities implementation.
Click for more information about deleting entities from a target environment using a TDM task.
The LUI must include the source environment which must be set as the active environment in Fabric. When running a Data Viewer on the LU to debug its implementation, do either:
_dev_
. For example, _dev_1.A TDM task copies a Business Entity (BE) from a source environment to a target environment. A BE can have multiple LUs with a flat or a hierarchical structure. For example, a Customer BE can consist of Customer Care, Billing, Ordering and Usage LUs. The ability to break a BE up into several LUs enables maximum flexibility and avoiding duplicate development. In addition, defining a hierarchical structure of parent-child LUs enables creating LUs based on the natural root entity of the related data sources instead of forcefully setting unified root entities on all LUs related to a given BE.
Each LU in a TDM project must have additional components to support TDM functionality, as described below:
Each LU in a TDM project has the following structure:
Dummy root table: FABRIC_TDM_ROOT.
Generic TDM LU tables that are linked to the root table.
Two main branches that are linked to the root table :
Source branch: LU tables that extract an entity's source data. Source LU tables are populated when a TDM task needs to load (insert) entities to a target environment and therefore must extract the source data of these entities.
Target branch: LU tables that extract the target keys of an entity. The keys are extracted from the target environment to enable deleting an entity from a target environment if required by the TDM task.
Click for more information about Fabric implementation and deleting entities from the target environment.
Import the TDM_LIBRARY LU from the TDM Library to your project and copy the LU level objects in the TDM_LIBRARY to your LU.
Click for more information about supporting hierarchy in the TDM implementation.
Link the main source LU tables to the FABRIC_TDM_ROOT table. The main source table represents the main (root) table in the data source. For example, the Customer table is the main source LU table of Customer LU.
Verify that the one of main source LU table is also populated in ROOT_TABLE_NAME and ROOT_COLUMN_NAME Globals.
Create the population of the main source LU tables based on the Root function. The generated root function contains the output fields and the select query on the source table.
Edit the Root functions generated for the LU tables based on the fnPop_RootTable function under the TDM_LIBRARY LU:
Copy the code of the fnPop_RootTable into the newly generated Root function of the LU table.
Add the following import to the root function:
This import is needed since the root function defines the instanceExists indicator as AtomicBoolean. Note that this indicator cannot be defined as a Boolean since it is set inside the Lambda expression in the loop on the ResultSet.
Edit the String sql variable to include the DB query on the DB table.
Edit the db parameter of the fetch command.
String sql = "SELECT CUSTOMER_ID, SSN, FIRST_NAME, LAST_NAME FROM main.CUSTOMER where customer_id = ?";
db("CRM_DB").fetch(sql, input).each(row->{
yield(row.cells());
});
The updated Root function populates the main source LU table under the following conditions:
Click to view the Override Sync Mode Summary Table.
As a result, if the Sync mode is set to Do not sync by the user, or the task is a delete only task, the source LU tables are not populated by the LUI sync.
This function also validates if the entity exists in the source table. If the entity is not found in the main source tables, this function throws an Exception and the entity is rejected.
See example of a root function that populates Customer LU table:
Link the remaining source LU tables to the main LU tables so that if the main source LU table is not populated, the remaining source LU tables also remain empty.
Mask sensitive data in LU tables using a Broadway population and the Masking Actor.
Click for more information about TDM Masking.
Edit trnLuParams and LU_PARAMS to enable a subset of entities from selected parameters for this LU.
Click for more information about Handling TDM Parameters.
Define the LU tables to extract the target keys to enable deleting an entity from the target.
Link the main target LU table to the FABRIC_TDM_ROOT table.
Add the fnDecisionDeleteFromTarget Decision function to all target LU tables. Note that this Decision function is under Shared Objects and is imported from the TDM Library.
Create the population of the main target LU table based on a Broadway flow. The Broadway flow must set the task's target environment to be the active environment in order to select the target IDs from the target environment.
Link the remaining target LU tables to the main target LU table.
Click for more information about the deleting entities implementation.
Click for more information about deleting entities from a target environment using a TDM task.
The LUI must include the source environment which must be set as the active environment in Fabric. When running a Data Viewer on the LU to debug its implementation, do either:
_dev_
. For example, _dev_1.