Data Model Editor

The Data Model Editor enables you to view and edit a data model. You can configure requests, responses, and service activity calls for individual operations of a virtual service.

To access

Use one of the following:

  • In the Virtualization Explorer, double-click a data model.
  • In the Virtual Service Editor, under Data Models, select a data model and click Edit.
Important information
  • Many of the actions you can perform in the Data Model Editor are available only from context menus. For details, see Data Model Editor Context Menus.
  • Service Virtualization supports MIME attachments that are recorded during learning of the real service behavior, for services using the following protocols over HTTP: REST, SOAP, binary, and XML services

Tip:  

  • To search the data model, click Ctrl+F.
  • To find and replace data, click Ctrl+H.
  • To access the Data Model Editor menus, press the Alt key and press a number from 1 - 6. For example, to open the View Options menu, press Alt + 5.
Relevant tasks
See also

User interface elements are described below (unlabeled elements are shown in angle brackets):

UI Element Description
<data model name and description> The name and description of the data model. Click to edit.
<operations/URI Spaces pane>

Operations pane. Located in the left pane of the editor. Displays a list of the operations in the service associated with the selected data model.

Enter text in the filter box to filter for specific operations in the list.

Select an operation from the list to display its details in the main pane of the Data Model Editor.

Operation Displays the name of the currently selected virtual service, and lists the operations in the virtual service. Select an operation from the list to display its details in the main pane of the Data Model Editor.
Learned Data

Learned Data rule. Created by default when you create a virtual service. Displays the requests and responses recorded during a learning session of a virtual service.

Default Response

Default Response rule. Created by default when you create a virtual service. The response that is provided when the data does not match any other rule. The Default Response rule always has the lowest priority.

<rule elements>

Rules in the data model contain the following elements:

  • Expand rule. Click the arrow before the rule number to expand a rule.

    For details on the functions used in rules, see Rule Functions.

  • Rule priority. The rule number indicates the order in which the rule is applied during simulation.

    To move a rule up or down in the list to change its priority, click the up/down icon after the rule number.

    Note: Not available for the Default Response rule.

  • Rule name and description. Click to edit. Available only for custom rules.
  • Import/Export icons. When the rule is associated with an external data file, one of the following icons is displayed:

    The data was imported from an external file.

    The data was imported from an external file and is configured to automatically re-import before each Simulation session.

    The data was exported to an external file.

    The data was exported to an external file and is configured to automatically re-export after each Learning session.

  • x/x rows. Indicates the number of rows for this rule in this operation, out of the total rows for this rule across all operations in this service.

Tip: Press Ctrl + the rule number to select a rule, or to expand/collapse the selected rule.

Enables you to create a new custom rule. Custom rules apply to all operations in the service. Includes the following options:

  • Blank Rule. Enables you to create a new, custom rule with an embedded data source, used to modify some aspect of simulation, such as to rewrite part of the response, add service call activity, or add more data.

    The blank rule can be added before or after the default Learned Data rule.

  • Scripted Rule (Beta). Enables you to create a new, custom rule with a script to access request data and set response data. For details, see Scripted Rules.

    Note: This field is displayed only if early access features are enabled. For details, see Early Access Features.

  • Data Driven Rule. Opens the New Data Driven Rule dialog box, enabling you to create a new rule using an external file as a data source, such as an Excel file. A new read-only rule is created for this data source.

    Select the data source file, and assign a name to the data source.

    Select First row contains names of columns to use the header row of the source file for the rule's column names.

    The data driven rule can be added before or after the default Learned Data rule.

For more details on rules, see Rule Functions.

Depending on the virtual service, displays options for the operations or URI spaces defined in the virtual service.

Includes the following options:

  • Browse and Search Operations/URI Spaces. Opens the Operations pane, displaying the list of operations included in the service.

    In the search box, enter a name or part of a name to search and filter for specific operations in the list.

    Select an operation from the list to display its details in the main pane of the Data Model Editor.

  • Edit Operations/URI Spaces. Opens the Service Description Editor, enabling you to modify the operations or URI spaces, their data formats, and metadata. For details, see Service Description Editor.

    Note: Available only for supported protocols.

  • Recently Used Operations/URI Spaces. Lists your most recently used operations or URI spaces, allowing you quick access.

Includes the following options:

  • Change Columns. Opens the Change Columns dialog box, enabling you to select the headers to display for the operation. For details, see Change Columns Dialog Box.

  • Flat/Structured Headers. Toggles between flat and structured column headers.

Includes the following option:

Insert Path. Enables you to select a path to a Service Virtualization element, and add it to a scripted rule.

Note: This field is displayed only if early access features are enabled. For details, see Early Access Features.

Enables you to configure the virtual service to call an external service:

  • Import Activities. Opens the Import Real Service Description dialog box, enabling you to import a service description of a service whose operations you can use as service call activities.

    Available for: SOAP and XML over HTTP.

Note: After import, the on/off icon displays in the activity column header in the rule, enabling you to enable/disable the service call for the rule.

Includes the following options:

  • Functions. Displays the function row within rules, enabling you to set conditions for data columns.
  • Highlight Columns. Displays column headers in different colors according to function type: Action, Condition, and Ignore.

    Default value: Off.

    To change the colors or restore the default color coding, from the main menu, select Tools > Options, and click the Data Model Editor tab. For details, see Data Model Editor Options Page.

  • Data Binding. Displays the data binding row within rules, enabling you to configure binding. For more details, see Data Driving.
  • Time Stamp. Displays the time stamp column within rules, which shows the time of creation or last modification of the rule.
  • Operations/URI Spaces Pane. Opens the Operations/URI Spaces pane, displaying the list of operations/URI spaces included in the service.

  • Simulation Preview. Displays how changes in the data model are affecting the simulation. For user interface details, see Simulation Preview Pane.

Displays the Track Position column within rules, and opens the track pane on the right side of the editor. For details, see Stateful Layout View.

For details on simulating stateful behavior, see Simulate a Stateful Service.