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
orPRODUCT
. 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
- Log on to the DMS console V5.0.
Move the pointer over the icon in the upper-left corner and choose
.NoteIf you use the DMS console in normal mode, choose
in the top navigation bar.Find the rule set of the target database, click Edit in the Actions column.
Go to the Details page of Security Rules. In the left-side navigation pane, choose .
Find the Default Template for Test Data Generation rule, click Edit in the Actions column.
In the Change Configuration Item dialog box, click Switch Approval Template.
In the Switch Approval Template dialog box, find the target approval template and click Select in the Actions column.
NoteYou can also click Reset to Free of Approval to skip the approval for tickets.
Click Submit.
Create an approval rule
- Log on to the DMS console V5.0.
Move the pointer over the icon in the upper-left corner and choose
.NoteIf you use the DMS console in normal mode, choose
in the top navigation bar.Find the rule set of the target database, click Edit in the Actions column.
Go to the Details page of Security Rules. In the left-side navigation pane, choose .
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.
NoteIf 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.
NoteIf you load a rule template from Template Database, the statement is automatically entered. If
Click Submit.
Enable the rule.
NoteThe new rule is Disabled by default. To enable this rule, click Enable in the Actions column, and then click OK.