Building Entity Lists on a Task's LUs

The task execution process executes the task's LUs from parent to child.

Click for more information about the execution order of hierarchical LUs.

The task execution process builds an entity list for each LU:

Root LUs

Extract Tasks

The entity list depends on the task:

Load Tasks - Regular Mode

The entity list depends on the task's selection method in the Requested Entities tab:

  • Entities List, build the entity list based on the entities in the task's Requested Entities tab.

  • Random Selection, randomly select the entities from the <LU Name>_<params> table.

  • Create Synthetic Entities, duplicate the Entity ID, set in the task. Attach a different clone_id on each clone.

    Example:

    Select Customer 1 from the ENV1 source environment and clone it four times. The following LUIs are generated:

    • ENV1_1#params#{"clone_id"=1}

    • ENV1_1#params#{"clone_id"=2}

    • ENV1_1#params#{"clone_id"=3}

    • ENV1_1#params#{"clone_id"=4}

  • Parameters, select the entities based on the task's parameters from a [DB view], created in the TDM DB for each BE and source environment combination.

Load Tasks - Data Flux Mode

  • Select All Entities is checked, copy the full list of successfully synced LUIs into Fabric by the selected version. The full list it taken from the Cassandra table:

    • Get the batch_id of the extract task that created the selected version from the task_execution_list in the TDM DB table.

    • Get the full list of completed entities by the selected batch id:

    SELECT entityID FROM k2batchprocess.batchprocess_entities_info 
    WHERE bid = <selected batch id> and status =  'COMPLETED' ALLOW FILTERING;
    
  • Select All Entities is unchecked, get the entities list from the task.

Children LUs

The entity list of a child LU must include all IDs related to parent IDs that have been successfully processed by the task execution.

Click for an execution of hierarchical BE example.

The generated entity list is based on a JOIN of the task_execution_entities and the TDM relationship tables:

Insert without Load Task

Select the children IDs from the task_execution_entities and tdm_lu_type_relation_eid tables:

SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_relation_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and t.source_env  = rel.source_env 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name> 
and rel.version_name = <empty string on a regular task and the selected version name on a Data Flux task>;

Delete before Load Task

Select the children IDs from the task_execution_entities and TDM relationship tables: tdm_lu_type_relation_eid and tdm_lu_type_rel_tar_eid to get the children IDs from the source and target environments:

SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_relation_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and t.source_env  = rel.source_env 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name> 
and rel.version_name = <empty string on a regular task and the selected version name on a Data Flux task>
UNION
SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_rel_tar_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and rel.target_env = <target environment name> 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name>; 

Delete Entity without Load Task

Select the children IDs from the task_execution_entities and tdm_lu_type_rel_tar_eid to get the target children IDs:

SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_rel_tar_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and rel.target_env = <target environment name> 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name>; 

Previous

Building Entity Lists on a Task's LUs

The task execution process executes the task's LUs from parent to child.

Click for more information about the execution order of hierarchical LUs.

The task execution process builds an entity list for each LU:

Root LUs

Extract Tasks

The entity list depends on the task:

Load Tasks - Regular Mode

The entity list depends on the task's selection method in the Requested Entities tab:

  • Entities List, build the entity list based on the entities in the task's Requested Entities tab.

  • Random Selection, randomly select the entities from the <LU Name>_<params> table.

  • Create Synthetic Entities, duplicate the Entity ID, set in the task. Attach a different clone_id on each clone.

    Example:

    Select Customer 1 from the ENV1 source environment and clone it four times. The following LUIs are generated:

    • ENV1_1#params#{"clone_id"=1}

    • ENV1_1#params#{"clone_id"=2}

    • ENV1_1#params#{"clone_id"=3}

    • ENV1_1#params#{"clone_id"=4}

  • Parameters, select the entities based on the task's parameters from a [DB view], created in the TDM DB for each BE and source environment combination.

Load Tasks - Data Flux Mode

  • Select All Entities is checked, copy the full list of successfully synced LUIs into Fabric by the selected version. The full list it taken from the Cassandra table:

    • Get the batch_id of the extract task that created the selected version from the task_execution_list in the TDM DB table.

    • Get the full list of completed entities by the selected batch id:

    SELECT entityID FROM k2batchprocess.batchprocess_entities_info 
    WHERE bid = <selected batch id> and status =  'COMPLETED' ALLOW FILTERING;
    
  • Select All Entities is unchecked, get the entities list from the task.

Children LUs

The entity list of a child LU must include all IDs related to parent IDs that have been successfully processed by the task execution.

Click for an execution of hierarchical BE example.

The generated entity list is based on a JOIN of the task_execution_entities and the TDM relationship tables:

Insert without Load Task

Select the children IDs from the task_execution_entities and tdm_lu_type_relation_eid tables:

SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_relation_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and t.source_env  = rel.source_env 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name> 
and rel.version_name = <empty string on a regular task and the selected version name on a Data Flux task>;

Delete before Load Task

Select the children IDs from the task_execution_entities and TDM relationship tables: tdm_lu_type_relation_eid and tdm_lu_type_rel_tar_eid to get the children IDs from the source and target environments:

SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_relation_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and t.source_env  = rel.source_env 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name> 
and rel.version_name = <empty string on a regular task and the selected version name on a Data Flux task>
UNION
SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_rel_tar_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and rel.target_env = <target environment name> 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name>; 

Delete Entity without Load Task

Select the children IDs from the task_execution_entities and tdm_lu_type_rel_tar_eid to get the target children IDs:

SELECT rel. rel.lu_type2_eid as child_entity_id
From FROM task_execution_entities t, tdm_lu_type_rel_tar_eid rel 
where t.task_execution_id= <task execution id> 
and t.execution_status = 'completed' 
and t.lu_name = <parent lu name> 
and rel.target_env = <target environment name> 
and t.lu_name = rel.lu_type_1 
and t.iid = rel. lu_type1_eid 
and rel.lu_type_2= <child lu name>; 

Previous