Working with Scenarios

As described earlier in this chapter, you use a DB-to-XML data source scenario to specify database connectivity settings. You create and modify DB-to-XML data source scenarios using the Scenario Properties dialog box.

This section describes how to open the Scenario Properties dialog box (Stylus Studio opens it for you automatically when you create a new DB-to-XML data source), and how to create new and modify existing scenarios.

This section covers the following topics:

Opening the Scenario Properties Dialog Box

There are two ways to open the Scenario Properties dialog box. Both allow you to work on existing scenarios or to create new ones.

To open the Scenario Properties dialog box:
  • Click in the DB-to-XML data source editor tool bar.
  • Select Create Scenario or an existing scenario from the scenario drop-down list at the top of the editor window.

Figure 315. Ways to Open the Scenario Properties Dialog Box

Creating a Scenario

This section describes how to create a DB-to-XML scenario.

Naming Scenarios

Stylus Studio supplies a default name, like Scenario0, for example. for new DB-to-XML scenarios. You can accept the default name, but you should consider typing a name that makes it easy to distinguish one scenario from another. See How to Rename a Scenario.

How to Create a Scenario

To create a scenario:
1. Open the DB-to-XML data source editor if it is not already open.
2. Select Create Scenario from the scenario drop-down list at the top of the editor window:

Figure 316. Creating a Scenario

Stylus Studio displays the Scenario Properties dialog box. The name field displays a default scenario name ( Scenario0, for example) in edit mode.

3. Change the default scenario name.
4. Specify the connection settings. See Specifying Connection Settings if you need help with this step.
5. Click OK to save the scenario with the new settings.

Stylus Studio connects to the server specified in the scenario.

Alternative

Use this procedure if the Scenario Properties dialog box is already open.

To create a scenario when the Scenario Properties dialog box is already open:
1. Click New on the Scenario Properties dialog box.

The name field displays a default scenario name ( Scenario0, for example) in edit mode.

2. Change the default scenario name.
3. Specify the connection settings. See Specifying Connection Settings if you need help with this step.
4. Click OK to save the scenario with the new settings.

Stylus Studio connects to the server specified in the scenario.

How to Modify a Scenario

You can modify a scenario at any time. Change that you make take effect as soon as you save the scenario.

To modify a scenario:
1. Display the Scenario Properties dialog box by clicking in the DB-to-XML data source editor tool bar.
2. In the Existing scenarios field, click the name of the scenario you want to modify.
3. Change the scenario's properties as needed. See Specifying Connection Settings if you need help with this step.
4. Click OK to save the new scenario.

Stylus Studio connects to the server specified in the scenario.

How to Clone a Scenario

When you clone a scenario, Stylus Studio creates a copy of the scenario except for the scenario name. This allows you to make changes to one scenario and then run both to compare the results.

To clone a scenario:
1. Display the Scenario Properties dialog box by clicking in the DB-to-XML data source editor tool bar.
2. In the Existing scenarios field, click the name of the scenario you want to clone.
3. Click Clone.

The name field displays a default scenario name ( Scenario0, for example) in edit mode.

4. Change the default scenario name.
5. Change the source scenario's connection settings as needed. See Specifying Connection Settings if you need help with this step.
6. Click OK to save the new scenario.

Stylus Studio connects to the server specified in the scenario.

How to Rename a Scenario

To rename a scenario:
1. Display the Scenario Properties dialog box by clicking in the DB-to-XML data source editor tool bar.
2. In the Existing scenarios field, click the name of the scenario you want to rename.
3. Click Rename.

The name field displays the scenario name in edit mode.

4. Change the scenario's name.
5. Click OK to save the new scenario.

Stylus Studio connects to the server specified in the scenario.

How to Delete a Scenario

To delete a scenario:
1. Display the Scenario Properties dialog box by clicking in the DB-to-XML data source editor tool bar.
2. In the Existing scenarios field, click the name of the scenario you want to delete.
3. Click Delete.

The scenario is deleted from Stylus Studio.

 
Free Stylus Studio XML Training: