User Guide > Data Subset > Entity Management
  

Entity Management

Manage entities to perform data subset operations.
You can create, edit, and delete entities in the Define | Data Subset view. You can export and import entities.

Creating an Entity

When you create an entity, you select the driving table. Test Data Manager retrieves the related tables based on the constraints. You can add filter criteria to the driving table to filter source data when you create the data subset database. You can disable relationships between tables in the entity.
Before you create an entity, perform data discovery to identify constraints. Add constraints to the source to define the child tables.
    1. Open a project.
    2. Click Define > Data Subset.
    3. Click Actions > New > Entities.
    4. In the New Entity dialog box, enter a name and optional description for the entity.
    5. Click Select Table to select a driving table from the list.
    6. Click OK.
    Test Data Manager displays a diagram of the relationship between the tables in the entity. You can view a list of the tables or a list that shows the relationships between the tables.
    7. To create a subset of the data based on filter criteria, click Edit in the Properties pane.
    The Edit Criteria dialog box appears.
    8. To add criteria for a column, click the Entity Criteria tab.
    9. Click Add Criteria.
    10. Select the columns on which you want to filter data and click OK.
    The columns that you selected appears in the columns list in the Entity Criteria tab.
    11. If you want to define the filter expression in the entity, select an operator from the list to filter the data.
    You can indicate a filter condition in the entity, but define the expression in the plan.
    12. If you enter a filter condition, enter a specific value or a variable to complete the filter expression.
    Note: If you want to provide a variable in the entity criteria, you must start the parameter value with "$$" for nonrelational sources. For relational sources, you must start the parameter value with "$".
    13. Click Save for each filter criteria that you create. If you define multiple filters in an entity, the filter conditions act as "AND."
    14. Select the rows and click Save to exit the Edit Criteria dialog box.

Parameter Values in Entity Criteria

A parameter file is an XML file that lists user-defined parameters and their assigned values. You can use parameters when you specify the criteria to create a data subset. Parameter files provide the flexibility to change parameter values each time you run a workflow.
When you use parameters to specify the criteria, you enter a parameter name instead of a specific value.
For example, you want to create a data subset that includes all rows with the EMPID greater than 100. Instead of entering the value as 100 in the value field, you enter the name of the parameter. Enter the parameter value as 100 in the parameter file.
Enter the criteria EMPID > $PARAMETERVALUE. The parameter file must contain an entry $PARAMETERVALUE=100.
Enter the parameter file name and the file path when you configure the plan.
When you use parameters for a string field or a date field on a relational source, you must enclose the value in single quotes in the parameter file.

Database Functions in Entity Criteria

You can use database functions in entity filter criteria. To ensure that TDM processes the filter query correctly, you must use the IN operator and a Select clause.
For example, consider filter criteria that uses the add_months database function. Workflow generation fails if the plan contains the query entered directly, as TDM does not recognize this as a database function. TDM is unable to pass the criteria with the database function as is to the database.
To use the filter criteria with a database function, use the IN operator and enter the query with a Select clause.
To add the required filter criteria, in the Edit Criteria dialog box, select the operator IN from the list of operators. Enter the database function as a Select clause in the Value field.
select HIREDATE from <table> where HIREDATE > add_months(current_date, -3)
The Entity Criteria tab in the Edit Entity dialog box contains fields to select the operator and enter the value for the criteria. The IN operator is selected and the select clause is entered in the value field.
TDM processes the filter criteria correctly and passes the query to the database. The workflow runs successfully with this entity criteria.

Editing an Entity

You can edit an entity to change the general properties, relationships, and filter criteria for tables.
    1. In a project, click Define | Data Subset.
    The Entities panel shows a list of the entities in the project.
    2. Click the entity name to open the entity.
    3. Click Actions > Edit.
    The Edit dialog box appears.
    4. On the General tab, edit the entity name, description, and status.
    5. On the Entity Criteria tab, select columns and enter filter criteria.
    6. Click Save.
    A list of any plans that the entity is included in appears. To update the changes in the plans, generate and run the plans again.
    7. Optional. To download the list of plans in a .csv file, click Export.
    The file contains a list of the plans with the description and the project information.
    8. Click Continue.

Optimizing Relations

By default, all constraint relationships within an entity are major. This can sometimes result in including excess data in the subset, when you run a subset operation. Optimize the relations such that the entity has a minimum number of major relations to ensure the subset operation fetches minimal data while considering all tables in the entity. You can also optimize relations at run time in a plan. When you optimize relations at run time, you do not save the changes to the entity.
The entity must have a criteria before you can optimize relations in the entity. TDM generates an error if you optimize relations without assigning criteria at the entity level.
Perform the following steps to optimize relations in an entity:
    1. Open the entity.
    2. Click Actions > Optimize Relations.
    TDM analyzes the constraints in the entity and proposes major relationships or minor relationships based on analysis. The Optimize Relationships page displays the proposed relationship between each parent table and child table along with the current relationship.
    3. Optional. Click Download Optimizations to download and save the optimization information in a CSV file.
    4. Click Optimize to accept all the proposed relationships. You cannot apply results selectively .
    A list of any plans that the entity is included in appears. To update the changes in the plans, generate and run the plans again.
    5. Optional. To download the list of plans in a .csv file, click Export.
    The file contains a list of the plans with the description and the project information.
    6. Click Continue.
    The entity is updated with the optimized relations. You can manually edit any required constraints even after you save the changes.

Exporting an Entity

You can export an entity to an XML file and import the XML file to another TDM repository.
    1. Click Projects to open the Projects view.
    A list of projects appears.
    2. Open the project that contains the entity to export.
    3. Click the Define view.
    The list of entities, groups, and templates in the project appear.
    4. Select an entity to export.
    Use the checkbox to select the entity.
    5. Click Actions > Export.
    6. Choose the name and path of the XML file to create.
    The default name is a string that contains "Entity_" and the current date and the time.
    7. Click OK.

Importing an Entity

You can import an entity from an XML file that was exported from another TDM repository.
    1. To open the Projects view, click Projects.
    2. Click the project description to select a project to import the entity into.
    Do not open the project.
    3. Click Actions > Import.
    4. Browse for the XML file that contains the entity to import.
    The XML file has a default name similar to Entity_130315081854.xml.
    5. To import the entity, click Finish.

Deleting an Entity

If you do not use an entity, you can delete the entity. If you delete an entity that is assigned to a plan, the plan is not valid.
    1. In the Define | Data Subset view in the project, click an entity name to select it.
    Do not open the entity.
    2. Click the Actions > Delete.
    3. In the Delete Entity message box, click OK.
    A list of any plans that the entity is included in appears. To update the changes in the plans, generate and run the plans again.
    4. Optional. To download the list of plans in a .csv file, click Export.
    The file contains a list of the plans with the description and the project information.
    5. Click Continue.