Advanced Generation Rules
Use advanced generation when you want to apply multiple generation techniques to a column or when you want to configure multiple input and output columns in the same generation rule. You can generate test data for string, numeric, and date data types.
When you configure an advanced generation rule, create input ports, output ports, and variable ports. Variable columns are work fields that you can define to temporarily store data.
When you create the ports in the generation rule, the port names do not need to be the same as the column names in the target metadata. When you assign the generation rule to columns, you must map the rule columns to the target table columns.
Create the following types of ports in an advanced rule:
- Input
- Optional. A port that takes input from a target column or from a parameter file. You do not need to map the input port to a column if the you parameterize the input port.
- Variable
- A port that contains intermediate values in a calculation. The variable column receives a value from a generation technique. You can use the following generation techniques to generate data in the temporary variables: Generation Rule Set and Conditional. You can select the generation rules that are available based on the data type of the port.
- You can create multiple variable ports and configure the variables based on a dependent variable port. You can configure multiple variable ports in order to combine multiple generation techniques.
- Output
- The target column that receives the generated data. The output column type contains an expression to generate test data.
With an advanced generation rule, you can configure generation rules with specific conditions for target columns. To generate test data in a column based on the values in another column, you can group the records based on foreign keys.
Advanced Generation Rule Example
You work for a sales department and you need to generate 100 records with 50 invoices and 50 orders. Create an advanced rule with an input column Ip_1 of string data type, a variable column Var_1, and an output column Out_1 of string data type.
Configure the conditional rule for the variable column and select a numeric sequence generation rule for the following two conditions:
- •Ip_1='Invoice-'
- •Ip_1='Order-'
To concatenate the input and variable columns to create an ID column, create an output column with the following expression:CONCAT(Ip_1,Var_1)
Assign the advanced generation rule to a column, create a plan, and run the workflow. TDM concatenates the columns and provides 50 invoices with results Invoice-1, Invoice-2,...,Invoice-50, and 50 orders with results Order-1, Order-2, ..., and Order 50.
The following image shows the advanced rule parameters that you can configure:
Creating an Advanced Generation Rule
Create an advanced generation rule to combine more than one generation technique or to generate test data in a single column or multiple columns.
1. To access the Policies view, click Policies.
2. Click Actions > New > Generation Rule.
The Rule Wizard appears.
3. Enter a name and an optional description for the rule.
4. Select the advanced generation rule type.
5. Click Next.
6. In the Input Columns section, click Add New.
The Add Column dialog box appears.
7. Enter the column properties, such as the column name, data type, precision, and scale.
You cannot enter dependencies for input columns.
8. If you want to enter a parameter name for an input column, select Parameterize Input Port and enter the parameter name.
When you assign a generation rule, you need not map the input column that has a parameter value.
9. Click OK.
10. To enter more input columns, click Create Port in the New generation Rule dialog box.
11. In the Variable Columns section, click Add New.
12. Enter the column properties, such as the column name, data type, precision, and scale. If you have more than one variable column, you can specify the variable dependency.
13. Click OK.
The variable column appears in the list of columns.
14. To configure a rule for the variable column, click Configure Rule.
The New Generation Rule dialog box appears.
15. Select the generation technique. You can choose a conditional generation rule or the generation rule set.
- - Conditional. Specify conditional expressions and select the generation rules. Click OK.
- - Generation Rule Set. Specify the generation rules and the distribution percentages. You can also create a generation rule. To group the records based on the foreign keys, select Group record by foreign key. Click OK.
16. In the Output Columns section, click Add New.
17. Enter the column properties, such as the column name, data type, precision, and scale.
You cannot enter dependencies for input columns.
18. Enter an expression for the output column. Click OK.
19. Click Finish.