All Products
Search
Document Center

Data Management:Test data generation

最終更新日:Nov 15, 2024

This topic describes how to modify and create approval processes for tickets for generating test data.

Precautions

The default approval template takes effect if you do not configure approval processes for tickets for generating test data under the Approval Rule Validation checkpoint. In the Switch Approval Template dialog box, you can Modify the default approval template.

Configuration items

Checkpoints

When a user submits a ticket for generating test data, Data Management (DMS) checks whether the ticket conforms to the rules specified under the checkpoint. Approval Rule Validation: In DMS, the tickets for generating test data are processed based on the rules specified under the Approval Rule Validation checkpoint. You can use the default rules provided in the template database of security rules or Create an approval rule.

Factors and actions

  • A factor is a predefined variable that is provided by DMS. You can use factors to obtain the context to be validated by security rules, such as the categories of SQL statements and the number of data rows to be affected. A factor name consists of the prefix @fac. and the display name of the factor. Each module of the Security Rules tab provides different factors for different checkpoints. The following table describes the factors provided for the checkpoints in Test Data Generation.

    Factor

    Description

    @fac.env_type

    The type of the environment. The value is the display name of the environment type, such as DEV or PRODUCT. To learn about more environment types, see Change the environment type of an instance.

    @fac.schema_name

    The name of the schema.

  • Action: An action is the operation that DMS performs after the conditions specified in the if statement are met. For example, DMS forbids the submission of a ticket, selects an approval process, approves a ticket, or rejects a ticket. Actions show the purposes of security rules. An action name consists of the prefix @act. and the display name of the action. Each module provides different actions for different checkpoints. The following table describes the actions provided for the checkpoints in Test Data Generation.

    Action

    Description

    @act.forbid_submit_order

    Forbids the submission of the ticket. The statement is in the following format: @act.forbid_submit_order 'Reasons for forbidding the submission of the ticket'.

    @act.do_not_approve

    Specifies the ID of an approval template. For more information, see Configure approval processes.

Template database

DMS provides a large number of predefined security rule templates. You can enable the templates or modify the templates based on your business requirements. The template database in Test Data Generation provides the following templates:

  • No approval for test databases

  • Disable test data generation

  • Forbid test data generation for production databases

Modify the default approval template

  1. Log on to the DMS console V5.0.
  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All functions > Security and Specifications > Security Rules.

    Note

    If you use the DMS console in normal mode, choose Security and Specifications > Security Rules in the top navigation bar.

  3. Find the rule set of the target database, click Edit in the Actions column.

  4. Go to the Details page of Security Rules. In the left-side navigation pane, choose Database Development > Test Data Generation.

  5. Find the Default Template for Test Data Generation rule, click Edit in the Actions column.

  6. In the Change Configuration Item dialog box, click Switch Approval Template.

  7. In the Switch Approval Template dialog box, find the target approval template and click Select in the Actions column.

    Note

    You can also click Reset to Free of Approval to skip the approval for tickets.

  8. Click Submit.

Create an approval rule

  1. Log on to the DMS console V5.0.
  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All functions > Security and Specifications > Security Rules.

    Note

    If you use the DMS console in normal mode, choose Security and Specifications > Security Rules in the top navigation bar.

  3. Find the rule set of the target database, click Edit in the Actions column.

  4. Go to the Details page of Security Rules. In the left-side navigation pane, choose Database Development > Test Data Generation.

  5. Select Basic Configuration Item for Checkpoints. Then, click Create Rule, and configure the following items:

    Configuration item

    Required

    Description

    Checkpoints

    Yes

    Select Approval rule validation for Checkpoints.

    Template Database

    No

    The template that you want to use to create the security rule. DMS provides a large number of security rule templates. After you select a checkpoint, click Load from Template Database to select a template. For more information about available templates, see Configuration items.

    Rule Name

    Yes

    The name of the custom security rule.

    Note

    If you load a rule template from Template Database, the rule name is automatically entered.

    Rule DSL

    Yes

    The DSL statement that you want to use to configure the security rule. For more information, see DSL syntax for security rules.

    Note

    If you load a rule template from Template Database, the statement is automatically entered. If

  6. Click Submit.

  7. Enable the rule.

    Note

    The new rule is Disabled by default. To enable this rule, click Enable in the Actions column, and then click OK.