Create and Manage Variables

The CA TDM Portal lets you use variables while editing the test data. These variables are resolved to appropriate values when you publish the test data. The two variable types are as follows:
tdm41
The CA TDM Portal lets you use variables while editing the test data. These variables are resolved to appropriate values when you publish the test data. The two variable types are as follows:
  • Standard
    These variables are standard functions that you use to manipulate data when you publish.
    For example, the standard variable
    ~CDATE~
    resolves to the current date as defined in the project settings. You can use this value to identify the current data that is defined in the connection profile to which you are publishing.
  • User Defined
    These variables are created by users.
    For example, create a variable named FIRSTNAME with a default value as
    @randlov(0,@seedlist(FirstName)@)@
    . Add this variable to the data in the form of ~FIRSTNAME~. When the data is published, the variable is resolved to an appropriate value. This variable is a user-defined variable that serves the appropriate business requirement. This approach of using a variable instead of a complete expression also improves the user experience, because you do not have to read the complex expression to understand what it implies. You can simply give a meaningful name to your defined variable to easily understand its purpose.
    In more advanced use cases, user defined variables can be used like macros.
Variables follow the
~
variablename
~
format in the Portal.
This article covers the following procedures:
Understand the Variable Scope
You can define variables with the following scope:
  • Repository
    A variable that is defined with the repository scope is accessible to all the projects, versions, and generators. This is a global variable.
  • Project
    A variable that is defined with the project scope is accessible to that project, versions associated to the project, and generators associated to the project.
  • Version
    A variable that is defined with the version scope is accessible to that version and generator associated to the version. This variable is not accessible to the repository and projects.
  • Generator
    A variable that is defined with the generator scope is accessible only to that generator. This variable is not accessible to the associated projects and versions.
    When you view the list of variables for a generator, all variables that are defined with a higher scope (repository, associated project, and associated version) are also displayed. These variables are in addition to the ones that are explicitly defined for that generator. However, if a variable with the same name is defined for the repository (project, version, or generator), then only the variable for the generator is listed when you try to view the list of variables for a generator.
    For example, you create a variable
    Name
    with the project scope and set its value to
    John
    . You create another variable
    Name
    with the generator scope and set its value to
    Mitchel
    . Now, for the generator, the Portal displays the
    Name
    variable that is defined explicitly for that generator; it does not display the
    Name
    variable that is defined for the project. Therefore, in this case, the
    Name
    variable resolves to the value
    Mitchel
    , which is specified for the generator variable.
Considerations
Review the following considerations:
  • Variables that follow a cyclic dependency (loop) are not supported.
    For example, consider a scenario where a variable
    Var1
    includes another variable
    Var2
    as its default value. The variable
    Var2
    in turn includes the variable
    Var1
    as its default value. In this case, the Portal displays an error when you try to add such variables to the table cell.
  • Variables can resolve the hierarchy, if used.
    For example, a variable
    Var1
    includes
    HR
    as its value. Another variable
    Var2
    includes the variable
    Var1
    as its default value. So, the value of the variable
    Var2
    becomes
    HR
    . Now, you create another variable
    Var3
    , which includes the variable
    Var2
    as its default value. In this case, the value of the variable
    Var3
    also resolves to
    HR
    .
  • For a generator, you cannot edit or delete a variable if it is an inherited variable.
    For example, you define a variable
    Var1
    with the project scope. This project variable (
    Var1
    ) automatically becomes accessible to the generator (for example,
    Gen 1
    ) that is associated to that project. Now, if you view the variables for
    Gen 1
    , you can find that the variable
    Var1
    is also listed as one of the variables in the list. If you try to edit or delete the version
    Var1
    , you cannot do so, because it is an inherited variable. You can identify whether a variable is an inherited variable by reviewing the value in the
    Scope
    column.
  • The display type GENERAL in Datamaker is represented as Text Box in the Portal.
  • In Datamaker, if you have created variables at the Data Group, Data Set, or Data Pool level for a project, all these variables are listed under the associated generator in the Portal. Also, the
    Scope
    column value is blank for them in the Portal. That is, the actual inheritance is not shown in this case.
  • In Datamaker, if you have created variables with the same name at the Data Group, Data Set, or Data Pool level, only the variable belonging to the lowest level is shown in the Portal. If you delete this variable from the Portal, the variable is deleted. But, the variables list still shows a variable with the same name to be present in the list, because another variable with the same name is already present at a higher level in the hierarchy. In this case, you delete the variable that is at the lowest level, and then the variable that is defined at the next level is shown in the list.
    For example, you create variables with the same name (
    Var1
    ) in Datamaker at these levels—Data Group, Data Set, and Data Pool. Now, the variable
    Var1
    that is defined at the lowest level (Data Pool) is shown in the Portal, not the
    Var1
    variables defined at the other two levels. You now delete the displayed
    Var1
    variable from the Portal, the list still shows the variable
    Var1
    to be present. The
    Var1
    variable that the list now shows is the one that is defined at the next higher level in Datamaker, which is Data Set.
  • The variable type GENERAL (which is present in Datamaker) is not available in the Portal. However, for the backward compatibility, the Portal supports the editing of the variables of type GENERAL that are coming from Datamaker.
Variable Access Permissions
To perform actions in the Portal, you must have access to specific privileges. These privileges come from the security functions that are associated to groups. And, users are part of these groups. Therefore, by being part of a group, users have access to the associated security functions, which allow them to perform appropriate tasks in the Portal.
In the context of variables, users who are part of a group that has access to the below-mentioned security functions can only create, update, delete, and view variables in the Portal. If users are not part of such user groups, they cannot view and use the variable-related functionality in the Portal. The following table shows the specific security functions that are required to work with variables:
Variable Scope
Tasks
Security Functions
Project, Version, and Generator
Create, Update, and Delete variables
Data Definition (for a specific project)
View variables
Publish Data or Data Definition (for any project)
Repository
Create, Update, and Delete variables
Data Definition (for All Projects)
View variables
Publish Data or Data Definition (for any project)
For example, if you want to create a variable with the project scope, you must be part of a user group that has access to the Data Definition security function for a project for which you are creating the variable. In this case, you can access the
Variables
option under
Modeling
and can proceed with the variable creation process.
To create a data generator in the Portal, you must have access to the Edit Object security function. Similarly, to create projects and versions, you must have access to the Maintain Project security function.
Create a Variable
You can create variables with the repository, project, version, or generator scope.
Create a Variable with the Repository, Project, or Version Scope
You can create variables with the repository, project, or version scope based on your business requirements.
This procedure shows the most common way of creating a variable with the repository, project, or version scope. You can also create variable from other views. For more information, see Other Views from Which You Can Create Variables.
Follow these steps:
  1. Access the CA TDM Portal.
  2. Select an appropriate project and its corresponding version from the
    Project
    drop-down list in the top blue bar.
    This selection sets the required project and version context for all the related operations that you perform in the Portal.
  3. Click
    Modeling
    in the left pane.
    The
    Modeling
    option expands and displays two options:
    Objects
    and
    Variables
    .
  4. Click
    Variables
    .
    The
    Variables
    page opens.
  5. Click the
    New Variable
    button.
    The
    Create Variable
    page opens.
  6. Enter information in the following fields:
    • Name
      Specifies an appropriate name for the variable.
    • Description
      Specifies an appropriate description for the variable.
    • Scope
      Specifies the scope of the variable. Select the required scope from this drop-down list:
      • Repository
      • Project
      • Version
      To create a variable with the generator scope, see Create a Variable with the Generator Scope in this article.
    • Type
      Specifies the type of the variable that you are creating. You can select one of the following types:
      • String
      • Number
      • Date
      • Boolean
  7. Select a value from the
    Display Type
    drop-down list to specify how you want to display the variable in the Portal. The type of display depends on the variable type that you select.
    The values that you provide for validation are case-sensitive.
    Variable Type: String
    The supported display types are Text Box, Drop Down List, Multi Select List, and Radio Button.
    • For Text Box, use the following field and then proceed with Step 8:
      • Default Value
        Specifies a default value for the variable. You can use one variable as a default value in another variable. You can also use a data generator expression as a default value. Use the
        Data Painter
        dialog to create and validate the data generator expression. To access the
        Data Painter
        dialog, click the data painter icon (next to the field). For more information about how to work with Data Painter, see Create Data Generation Rules.
    • For Drop Down List, Multi Select List, and Radio Button, use the following fields and then proceed with Step 8:
      • List Definition
        Provides a list of values that you want to use as options. Use the aslist() and getsql() functions in the
        Data Painter
        dialog. These functions are displayed in the
        Data Painter
        dialog only in the context of these display types. Otherwise, they are not displayed. To access the
        Data Painter
        dialog, click the data painter icon (next to the field). For more information about how to work with Data Painter, see Create Data Generation Rules.
      • Default Value
        Specifies the default value.
      • Validate
        Lets you verify whether the default value is part of the options defined in the
        List Definition
        field. Click the
        Validate
        button for the verification.
    Variable Type: Number
    The supported display types are Text Box, Drop Down List, Multi Select List, and Radio Button.
    • For Text Box, use the following fields and then proceed with Step 8:
      • Include Validation
        Enables the rule that you define in the
        Rule Definition
        field. The default value that you provide in the
        Default Value
        field is then validated against the defined rule. When you enable the
        Include Validation
        option, the
        Rule Definition
        field is also enabled.
      • Rule Definition
        Lets you define the rule that you want to use for the variable. You can select from the following options:
        • In Values
          Specifies that the only valid values are those in the comma-separated list of values you provide in the corresponding field.
          For example, if you provide the list of values as
          1,2,3,4,5
          , then the default value is validated against this list. If you specify the default value as
          6
          (which is not part of the list) and click the
          Validate
          button, an error message appears in the
          Validate
          field. This message states that the resolved default value is not present in the defined rule. However, if you specify the value as
          3
          (which is part of the defined list) and click
          Validate
          , the value
          3
          is validated and is displayed in the
          Validate
          field with a tick mark, indicating that the value complies with the defined rule.
        • Greater Than
          Specifies that the value must be larger than this value. Select Greater Than and provide the appropriate value in the field.
          For example, if you specify the value as
          100
          , then the default value must be greater than
          100
          .
        • Less Than
          Specifies that the value must be smaller than this value. Select Less Than and provide the appropriate value in the field.
          For example, if you specify the value as
          100
          , then the default value must be smaller than
          100
          .
        • Between
          Specifies that the value must be within this range. Select Between and provide the appropriate range in the fields.
          For example, if you specify the range values as
          100
          in the first field and
          109
          in the second field, then the default value must be within this range.
      • Default Value
        Specifies the default value.
      • Validate
        Lets you verify whether the default value is part of the defined rule. Click the
        Validate
        button for the verification.
    • For Drop Down List, Multi Select List, and Radio Button, use the following fields and then proceed with Step 8:
      • List Definition
        Provides a list of values that you want to use as options.
      • Default Value
        Specifies the default value.
      • Validate
        Lets you verify whether the default value is part of the options defined in the
        List Definition
        field. Click the
        Validate
        button for the verification.
    Variable Type: Date
    The supported display types are Date Picker, Drop Down List, Multi Select List, and Radio Button. The supported date formats are
    yyyy/MM/dd
    ,
    yyyy.MM.dd
    ,
    yyyy-MM-dd
    ,
    MM/dd/yyyy
    ,
    MM.dd.yyyy
    ,
    MM-dd-yyyy
    ,
    dd/MM/yyyy
    ,
    dd.MM.yyyy
    ,
    dd-MM-yyyy
    ,
    yyyy-dd-MM
    ,
    yyyy/dd/MM
    , and
    yyyy.dd.MM
    .
    • For Date Picker, use the following fields:
      • Include Validation
        Lets you enable the rule that you define in the
        Rule Definition
        field.
      • Rule Definition
        Lets you define the rule that you want to use for the variable. You can select from the following options:
        • In Values
        • Greater Than
        • Less Than
        • Between
      • Default Value
        Specifies the default value.
      • Validate
        Lets you verify whether the default value is part of the defined rule. Click the
        Validate
        button for the verification.
    • For Drop Down List, Multi Select List, and Radio Button, use the following fields and then proceed with Step 8:
      • List Definition
        Provides a list of values that you want to use as options.
      • Default Value
        Specifies the default value.
      • Validate
        Lets you verify whether the default value is part of the options defined in the
        List Definition
        field. Click the
        Validate
        button for the verification.
    Variable Type: Boolean
    The supported display type is Check Box. Use the following fields for this display type:
      • Checked Value
        Specifies the value to use when the variable is selected.
      • Unchecked Value
        Specifies the value to use when the variable is not selected.
      • Default Value
        Specifies the default value.
      • Validate
        Lets you verify whether the default value is part of the options defined in the
        Checked Value and Unchecked Value
        fields. Click the
        Validate
        button for the verification.
  8. Enter information in the following fields:
    These fields are applicable only for the Data Catalog form.
    • Help Message
      Specifies the appropriate text that is displayed as a tooltip for the variable in the Data Catalog form.
    • Optional
      Specifies whether the variable that you are creating is optional in the Data catalog form.
    • Display Only
      Specifies whether the variable is displayed in the read-only mode in the Data Catalog form. That is, only for the information purpose.
  9. Select the
    Resolve Prior to Publish
    option if you want to resolve the variable before you start the publishing process. If you select this option, the variable value is resolved before the publishing and the same is used at all the places where the variable is referred. If you do not select this option, the variable is resolved during the publishing and the value is inserted at the time of publishing.
    For example, consider a variable value that contains an expression (for example,
    @addrand(100,1,10)@
    ). This expression adds a random number between
    1
    and
    10
    , starting with
    100
    as the base (for example,
    101
    ,
    102
    ,
    103
    ...
    110
    ). So, when you select
    Resolve Prior to Publish
    and publish the data, the expression gets resolved to a random number; for example,
    105
    . Now, this value
    105
    is used at all the places where the variable is being referenced. However, if you do not select
    Resolve Prior to Publish
    and publish the data, all the variable references get different random values (for example,
    103
    ,
    104
    ,
    105
    ,
    110
    ,
    107
    , and so on) during the publishing.
  10. Click
    Save
    .
    The variable is added to the
    Variables
    page.
Create a Variable with the Generator Scope
When you create a variable with the generator scope, that variable is accessible only to that generator.
This procedure shows the most common way of creating a variable with the generator scope. You can also create variable from other views. For more information, see Other Views from Which You Can Create Variables.
Follow these steps:
  1. Access the CA TDM Portal.
  2. Select an appropriate project and its corresponding version from the
    Project
    drop-down list in the top blue bar.
    This selection sets the required project and version context for all the related operations that you perform in the Portal.
  3. Click
    Generators
    in the left pane.
    The
    Data Generators
    page opens. This page lists all the generators that are available for the project and version that you selected in Step 2.
  4. Click the generator for which you want to create a variable.
    The
    <Generator_Name>
    page opens.
  5. Click the
    Variables
    button.
    The
    Variables
    page opens.
  6. Click the
    New Variable
    button.
    The
    Create Variable
    page opens.
  7. Enter the required information as explained in Create a Variable with the Repository, Project, or Version Scope.
    The variable is added to the
    Variables
    page. This section also includes those variables that are defined for the associated repository, project, and version.
Create and Manage Macros
As a Test Data Engineer or Tester, you sometimes want to be able define macros, so that you can reuse complex queries in various locations. You can use macros like custom functions that use parameters as arguments, and return a value. The value associated with a macro is an expression that can contain functions, variables, column references, and constants. In expressions, you refer to parameters in the form
#param#
. If your expression contains literal hash characters, represent them using the
@hashsign()@
function, otherwise they will be misinterpreted as parameters.
Create a macro using the following format:
  • Variable name:
    MyMacroName(param1, param2, param3, ...)
  • Variable value:
    @function(#param1#, #param2#, #param3#, …)@
Test Data Manager
checks for existing variables with the same name. Duplicates are not possible. If you already have defined a macro that is named
MyMacroName(param1)
, you cannot create another macro or variable
MyMacroName(param1,param2)
nor
MyMacroName
.
  1. Open the Portal and click
    Modelling, Variables
    .
    Note: You can create macros from all UIs where variables are created, at any level.
  2. Define the variable name, for example:
    MyAddFunc(num1, num2)
  3. Define the variable value, for example, this macro function adds two values:
    @add(#num1#, #num2#)@
  4. Use the macro in a Generator cell by plugging in specific values, for example:
    ~MyAddFunc(123, 456)~
    This macro returns the value 579.
Arguments to a macro can be any expression, including other variables, functions, strings, numbers, column references, or macros. Variables etc. will be resolved, but note that Boolean expressions are read literally. If you really want a Boolean expression to be evaluated, use the
@and
function
Macro
Values
Argument interpretation
~mymacro(~v1~=~v2~)~
v1=1 and v2=2
1=2
~mymacro(@and(~v1~=~v2~)@)~
v1=1 and v2=2
false
Macro use case examples:
  • If the argument is more than 5, then output the string "yes", otherwise out "no". For example, ifmore5(6) returns yes.
    ifmore5(a) = @if(#a# > 5, yes, no)@
  • The Factorial function. For example, factorial(10) returns 3628800.
    Factorial(a) = @case(#a# < 0, error, #a# = 0, 1, #a#=1, 1, @multiply(#a#,~factorial(@subtract(#a#,1)@)~)@)@
  • Add three numbers and the value of variable OFFSET. If the result is more than 100, then output the string "std", otherwise "non-std".
    Addcheck(a,b,c) = @if(@sum(#a#,#b#,#c#,~OFFSET~)@ > 1000, std, non-std)@
Other Views from Which You Can Create Variables
In addition to the main procedures that describe how to create variables, the Portal also allows you to create variables from other views. These views give you the flexibility of creating variables
inline
; that is, without loosing your current context.
Create Variables from the <Data_Generator_Name> Page
You can also create variables from the data generator view while defining data generation rules. This approach is helpful in situations where you are in the process of defining data generation rules. And, you want to add a variable to a table cell; however, the variable does not exist in the Portal. In this case, you want to create a variable, but do not want to move out of your current view. Your current view, the data generator page, provides an option that lets you access the
Create Variable
dialog. You can then define the variable and can proceed with your data generation rules.
Follow these steps:
  1. Access the CA TDM Portal.
  2. Select an appropriate project and its corresponding version from the
    Project
    drop-down list in the top blue bar.
    This selection sets the required project and version context for all the related operations that you perform in the Portal.
  3. Click
    Generators
    in the left pane.
    The
    Data Generators
    page opens. This page lists all the generators that are available for the project and version that you selected in Step 2.
  4. Click the generator for which you want to write data generation rules.
    The
    <Generator_Name>
    page opens
  5. Click the
    Select Tables
    button.
  6. Click the table where you want to add data generation rules.
    The table is added to the
    <Generator_Name>
    page.
  7. Identify the table cell where you want to add the variable.
    The same steps are applicable to create a variable if you use the First Row Display view. For more information about the first row display, see Create Data Generation Rules.
  8. Add the required variable (for example,
    ~MyVar~
    ) to the table cell.
    A red error icon with an error message is displayed next to the variable name. The red icon is displayed when you move the pointer out of that cell. The message states that the variable that you are trying to add to the table cell does not exist. The message also provides an option (
    Create Variable
    ) to create the variable.
  9. Click the
    Create Variable
    button in the error message.
    The
    Create Variable
    dialog opens, displaying the basic view. The basic view expects the least amount of information that is required to create a variable.
  10. (Optional) Click the
    Advanced View
    button to access the advanced view, which includes more fields.
    The
    Create Variable
    page opens. This page includes all the fields. For more information, see Create a Variable with the Repository, Project, or Version Scope.
  11. Enter information in the fields as required and save the information.
    The
    <Generator_Name>
    page opens. Review that the table cell now displays the variable with a green tick mark, which implies that the variable that you are trying to use is available in the Portal. You can now use this variable and proceed with your data generation rules.
Create Variables from the Data Painter Dialog
If you are in the
Data Painter
dialog and want to create a variable that does not exist, you can do so. This ability is helpful if you are creating an expression in the Data Painter dialog and you want to add a variable that does not exist. In this case, you do not need to move out of the current context. You can access the variable creation dialog from the same view.
Follow these steps:
  1. Access the CA TDM Portal.
  2. Select an appropriate project and its corresponding version from the
    Project
    drop-down list in the top blue bar.
    This selection sets the required project and version context for all the related operations that you perform in the Portal.
  3. Click
    Generators
    in the left pane.
    The
    Data Generators
    page opens. This page lists all the generators that are available for the project and version that you selected in Step 2.
  4. Click the generator for which you want to write data generation rules.
    The
    <Generator_Name>
    page opens
  5. Click the
    Select Tables
    button.
  6. Click the table where you want to add data generation rules.
    The table is added to the
    <Generator_Name>
    page.
  7. Click in the table cell where you want to add the rule and select the Data Painter icon (paint brush icon) from the pop-up menu.
    The
    Data Painter
    dialog opens.
  8. Perform the following tasks based on your requirements:
    Create a Variable by Converting the Complete Expression into a Variable
    1. Enter the expression in the text field; for example,
      @randlov(0,@seedlist(UK Address)@)@
      .
    2. Select the complete expression, because you want to convert the complete expression into a variable. Whatever you select in the text field becomes the default value of the variable.
    3. Click the
      Create Variable
      button.
      The
      Create Variable
      dialog opens, displaying the basic view. The basic view expects the least amount of information that is required to create a variable. Click the
      Advanced View
      button to access the advanced view, which includes more fields. The
      Create Variable
      page opens. This page includes all the fields. For more information, see Create a Variable with the Repository, Project, or Version Scope.
    4. Review that the default value is displayed as
      @randlov(0,@seedlist(UK Address)@)@
      in the dialog, which is the same expression that you selected in the text field.
    5. Enter information in the fields as required and click
      Save
      .
      The
      Data Painter
      dialog appears. Review that the text field includes the variable name.
    6. Click
      Validate
      to validate the variable.
      An appropriate value (for example,
      Orchard Road
      ) is displayed after validating the variable expression.
    7. Click the
      Insert
      button.
      The
      <Generator_Name>
      page opens. Review that the table cell now includes the variable name; for example,
      ~Address~
      . The default value of this variable corresponds to the complete expression.
    8. Move the pointer out of the table cell.
      A tick mark icon appears after the variable name, which suggests that the variable is successfully added to the table cell. You have successfully converted an expression into a variable.
    Create a Variable by Converting a Part of the Expression into a Variable
    1. Enter the expression in the text field; for example,
      @randlov(0,@seedlist(UK Address)@)@
      .
    2. Select a part of the expression; for example,
      @seedlist(UK Address)@
      , because you want to convert only a part of the expression into a variable.
    3. Click the
      Create Variable
      button.
      The
      Create Variable
      dialog opens. Review that the default value is displayed as
      @seedlist(UK Address)@
      , which is the same expression segment that you selected in the text field.
    4. Enter information in the fields as required and click
      Save
      .
      The
      Data Painter
      dialog appears. Review that the text field includes the variable name in the expression; for example,
      @randlov(0,~Address~)@
      .
    5. Click
      Validate
      to validate the variable.
      An appropriate value (for example,
      Hayward Road
      ) is displayed after validating the variable expression.
    6. Click the
      Insert
      button.
      The
      <Generator_Name>
      page opens. Review that the table cell now includes the variable name (
      ~Address~
      ) as part of the expression; for example,
      @randlov(0,
      ~Address~
      )@
      .
    7. Move the pointer out of the table cell.
      A tick mark icon appears after the variable name, which suggests that the variable is successfully added to the table cell. You have successfully converted a part of the expression into a variable.
    Create a Variable Without Converting Any Expression
    1. Enter the variable name (for example,
      ~FirstName~
      ) in the text field and click
      Validate
      .
      An error message appears. The message states that the variable does not exist and gives you the option to create it.
    2. Click the
      Create Variable
      button in the message.
      The
      Create Variable
      dialog opens. Review that the dialog does not include any default value, because you did not select anything in the text field.
    3. Enter information in the fields as required and click
      Save
      .
      The
      Data Painter
      dialog appears. Review that the text field displays the variable name, which is
      ~FirstName~
      .
    4. Click
      Validate
      .
      The Portal validates and resolves the variable to an appropriate value based on what you specify in the default value.
    5. Click
      Insert
      .
      The
      <Generator_Name>
      page opens. Review that the table cell now includes the variable name.
    6. Move the pointer out of the table cell.
      A tick mark icon appears after the variable name, which suggests that the variable is successfully added to the table cell.
    You have successfully created variables from other views.
Edit a Variable
If you want to update the variable information to reflect changed requirements or use cases, you can edit the defined variable.
Follow these steps:
  1. Access the CA TDM Portal.
  2. Select an appropriate project and its corresponding version from the
    Project
    drop-down list in the top blue bar.
    This selection sets the required project and version context for all the related operations that you perform in the Portal.
  3. For the repository, project, and version variables, follow these steps:
    1. Click
      Modeling
      in the left pane.
      The
      Modeling
      option expands and displays two options:
      Objects
      and
      Variables
      .
    2. Click
      Variables
      .
      The
      Variables
      page opens.
  4. For the generator variables, follow these steps:
    1. Click
      Generators
      in the left pane.
      The
      Data Generators
      page opens.
    2. Click the generator that includes the variable that you want to update.
      The
      <Generator_Name>
      page opens.
    3. Click the
      Variables
      button.
      The
      Variables
      page opens.
    For generators, you can edit only those variables that are created with the generator scope.
  5. Locate the variable in the table.
  6. Click the row corresponding to the identified variable.
    The
    Edit Variable
    page opens.
  7. Update the information in the following fields:
    • Description
    • Type
    • Display Type
      Based on the display type and the corresponding variable type, the
      List Definition
      ,
      Include Validation, Rule Definition, Checked Value
      , and
      Unchecked Value
      fields are displayed. For example,
      List Definition
      is displayed if you select the String variable type and Drop Down List display type.
    • Default Value
    • Help Message
    • Optional
    • Display Only
    • Resolve Prior To Publish
  8. Click
    Save
    .
    The changes are saved and the updated variable information becomes available.
Delete a Variable
If you do not need a variable in your environment, you can delete it from the Portal. You must have appropriate privileges to delete a variable.
Follow these steps:
  1. Access the CA TDM Portal.
  2. Select an appropriate project and its corresponding version from the
    Project
    drop-down list in the top blue bar.
    This selection sets the required project and version context for all the related operations that you perform in the Portal.
  3. For the repository, project, and version variables, follow these steps:
    1. Click
      Modeling
      in the left pane.
      The
      Modeling
      option expands and displays two options:
      Objects
      and
      Variables
      .
    2. Click
      Variables
      .
      The
      Variables
      page opens.
  4. For the generator variables, follow these steps:
    1. Click
      Generators
      in the left pane.
      The
      Data Generators
      page opens.
    2. Click the generator that includes the variable that you want to delete.
      The
      <Generator_Name>
      page opens.
    3. Click the
      Variables
      button.
      The
      Variables
      page opens.
    For generators, you can delete only those variables that are created with the generator scope.
  5. Locate the variable in the table.
  6. Click the Delete Variable icon (X icon) in the row corresponding to the identified variable.
    A confirmation dialog opens.
  7. Confirm the delete action.
    The variable is deleted from the list.
Example: Create and Use the
FIRSTNAME
Variable in the
First_Name
Column of the
Employee
Table
In this example, you create a variable
FIRSTNAME
that you want to use in the
First_Name
column of the
Employee
table. The variable is created with the project scope. The default value of the variable is set as
@randlov(0,@seedlist(FirstName)@)@
. After you create this variable, you use it in the
First_Name
column as
~FIRSTNAME~
. You decide to resolve this variable at the time of publishing so that the random first name values are generated during publishing.
Follow these steps:
  1. Access the CA TDM Portal.
  2. Select an appropriate project (for this example,
    Employee)
    and its corresponding version (for this example,
    1.0
    ) from the
    Project
    drop-down list in the top blue bar.
    This selection sets the required project and version context for all the related operations that you perform in the Portal.
  3. Click
    Modeling
    in the left pane.
    The
    Modeling
    option expands and displays two options:
    Objects
    and
    Variables
    .
  4. Click
    Variables
    .
    The
    Variables
    page opens.
  5. Click the
    New Variable
    button.
    The
    Create Variable
    page opens.
  6. Enter information in the following fields:
    • Name
      Enter the name of the variable as
      FIRSTNAME
      .
    • Description
      Enter the description as
      This variable adds first names
      .
    • Scope
      Specify the scope of the variable as
      Project
      .
    • Type
      Specify the type of the variable as
      String
      .
    • Display Type
      Specify the display type as
      Text Box
      .
    • Default Value
      Enter the default value as
      @randlov(0,@seedlist(FirstName)@)@
      and follow these steps to validate the expression:
      1. Click the data painter icon (next to the field).
        The
        Data Painter
        dialog opens. The expression is automatically populated in the text field above the
        Validate
        button.
      2. Click the
        Validate
        button.
        The expression is validated and a random value is displayed in the text field.
      3. Verify the value.
        If the value is not correct, review your expression and fix the issue.
      4. Close the
        Data Painter
        dialog.
        The entered expression is validated.
        For more information about how to use Data Painter, see Create Data Generation Rules.
    • Help Message
      Enter the tooltip that you want to display for this variable as
      This variable lets you add employee first names
      .
    • Optional
      Do not select this option for this example, because this variable is not an optional variable.
    • Display Only
      Do not select this option for this example, because this variable is not a read-only variable and is not for the information purpose.
    • Resolve Prior to Publish
      Do not select this option for this example, because you want to resolve this variable at the time of publishing to generate random data (first names).
  7. Click
    Save
    .
    The variable is added to the
    Variables
    section.
  8. Navigate to the page that lists all data generators.
  9. Click the data generator applicable (for example,
    Employee_Generator
    ) for this project.
  10. Click the
    Select Tables
    button and then select the
    Employee
    table.
    The
    Employee
    table is added to the data generator page.
  11. Click in the
    First_Name
    cell.
    A menu with different icons appears.
  12. Click the Variables icon (icon V) in the icons menu and select the
    FIRSTNAME
    variable from the list of variables that is displayed under
    Project
    .
    The variable is added as
    ~FIRSTNAME~
    in the
    First_Name
    table cell. You have successfully added a variable to a table.
  13. Click the
    Publish
    button to display the publishing dialog.
  14. Enter information that is required for this example as follows:
    • Enter
      1
      as a table count value.
    • Ensure that the
      Include Page
      option is selected.
    • Select the connection profile as
      Employee_Connection
      .
    • Select the schema as
      dbo
      .
    • Enter the repeat count as
      5
      .
    • Expand the
      Variables
      section and verify that the
      FIRSTNAME
      variable is present. Also, ensure that
      Default Values
      is selected in the
      Variables
      drop-down list.
    • Enter the email (for this example) where you want to send the publishing notifications.
    • Ensure
      Now
      is selected as the publishing schedule.
  15. Click
    Publish
    to start the publishing process.
    When the publishing job is completed, verify the target schema database to review that the
    First_Name
    column in the published data includes random first names. This verification ensures that the
    FIRSTNAME
    variable is resolved correctly during the publishing process.