Using User Functions Working with User Functions

13-2 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator external scheduler. Scenario execution and scheduling scenarios is covered in Chapter 20, Running Integration Processes .

13.2 Generating a Scenario

Generating a scenario for an object compiles the code for this object for deployment and execution in a production environment. To generate a scenario: 1. In Designer Navigator double-click the Package, Interface, Procedure or Variable under the project for which you want to generate the scenario. The corresponding Object Editor opens.

2. On the Scenarios tab, click Generate Scenario. The New Scenario dialog appears.

3. Enter the Name and the Version of the scenario. As this name can be used in an

operating system command, the name is automatically uppercased and special characters are replaced by underscores. Note that the Name and Version fields of the Scenario are preset with the following values: – Name : The same name as the latest scenario generated for the component – Version : The version number is automatically incremented if the latest version is an integer or set to the current date if the latest version is not an integer If no scenario has been created yet for the component, a first version of the scenario is automatically created. New scenarios are named after the component according to the Scenario Naming Convention user parameter. See Appendix B, User Parameters for more information.

4. Click OK.

5. If you use variables in the scenario, you can define in the Scenario Variables dialog the variables that will be considered as parameters for the scenario. Select Use All if you want all variables to be parameters, or Use Selected and check the parameter variables.

6. Click OK.

The scenario appears on the Scenarios tab and under the Scenarios node of the source object under the project.

13.3 Regenerating a Scenario

An existing scenario can be regenerated with the same name and version number. This lets you replace the existing scenario by a scenario generated from the source object contents. Schedules attached to this scenario are preserved. To regenerate a scenario: 1. Select the scenario in the Projects accordion. 2. Right-click and select Regenerate...

3. Click OK.

Working with Scenarios 13-3

13.4 Generating a Group of Scenarios

When a set of packages, interfaces, procedures and variables grouped under a project or folder is finished and tested, you can generate the scenarios. This operation takes place in Designer Navigator. To generate a group of scenarios: 1. Select the Project or Folder containing the group of objects. 2. Right-click and select Generate All Scenarios...

3. In the Scenario Generation dialog, select the scenario Generation Mode:

■ Replace : Overwrites for each object the last scenario version with a new one with the same ID, name and version. Sessions, scenario reports and schedules are deleted. If no scenario exists for an object, a scenario with version number 001 is created. ■ Re-generate : Overwrites for each object the last scenario version with a new one with the same id, name and version. It preserves the schedule, sessions and scenario reports. If no scenario exists for an object, no scenario is created using this mode. ■ Creation : Creates for each object a new scenario with the same name as the last scenario version and with an automatically incremented version number. If no scenario exists for an object, a scenario named after the object with version number 001 is created.

4. In the Objects to Generate section, select the types of objects for which you want

to generate scenarios.

5. In the Marker Filter section, you can filter the components to generate according

to a marker from a marker group.

6. Click OK.

7. If you use variables in the scenario, you can define in the Scenario Variables dialog the variables that will be considered as parameters for the scenario. Select Use All if you want all variables to be parameters, or Use Selected and check the parameter variables. Caution: Regenerating a scenario cannot be undone. For important scenarios, it is better to generate a scenario with a new version number. Note: If no scenario has been created yet for the component, a first version of the scenario is automatically created. New scenarios are named after the component according to the Scenario Naming Convention user parameter. See Appendix B, User Parameters for more information If the version of the last scenario is an integer, it will be automatically incremented by 1 when selecting the Creation generation mode. If not, the version will be automatically set to the current date. 13-4 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator

13.5 Exporting Scenarios

The export and import procedure allows you to transfer Oracle Data Integrator objects from one repository to another. It is possible to export a single scenario or groups of scenarios. Exporting one single scenario is covered in Section 19.2.1, Exporting one ODI Object . To export a group of scenarios: 1. Select the Project or Folder containing the group of scenarios. 2. Right-click and select Export All Scenarios... The Export all scenarios dialog opens. 3. In the Export all scenarios dialog, specify the export parameters as follows: 4. Select the type of objects whose scenarios you want to export. 5. Set the advanced options. This set of options allow to parameterize the XML output file format. It is recommended that you leave the default values.

6. Click OK.

The XML-formatted export files are created at the specified location.

13.6 Importing Scenarios in Production

A scenario generated from Designer can be exported and then imported into a development or execution repository. This operation is used to deploy scenarios in a different repository, possibly in a different environment or site. Parameter Description Export Directory Directory in which the export file will be created. Note that if the Export Directory is not specified, the export file is created in the Default Export Directory. Child components export If this option is checked, the objects linked to the object to be exported will be also exported. These objects are those visible under the exported object in the tree. It is recommended to leave this option checked. See Exporting an Object with its Child Components for more details. Replace existing files without warning If this option is checked, the existing file will be replaced by the ones of the export. Parameter Description XML Version XML Version specified in the export file. Parameter xml version in the XML file header. ?xml version=1.0 encoding=ISO-8859-1? Character Set Encoding specified in the export file. Parameter encoding in the XML file header. ?xml version=1.0 encoding=ISO-8859-1? Java Character Set Java character set used to generate the file. Working with Scenarios 13-5 Importing a scenario in a development repository is performed via Designer or Operator Navigator. With a execution repository, only Operator Navigator is available for this purpose. There are two ways to import a scenario: ■ Import uses the standard object import method. During this import process, it is possible to choose to import the schedules attached to the exported scenario. ■ Import Replace replaces an existing scenario with the content of an export file, preserving references from other objects to this scenario. Sessions, scenario reports and schedules from the original scenario are deleted and replaced with the schedules from the export file. Scenarios can also be deployed and promoted to production using versions and solutions. See Chapter 18, Working with Version Management for more information.

13.6.1 Import Scenarios

To import one or more scenarios into Oracle Data Integrator:

1. In Operator Navigator, select the Scenarios panel.

2. Right-click and select Import Import Scenario.

3. Select the Import Type. Refer to

Chapter 19, ExportingImporting for more information on the import modes.

4. Specify the File Import Directory.

5. Check the Import schedules option, if you want to import the schedules exported

with the scenarios as well.

6. Select one or more scenarios to import from the Select the files to import list.

7. Click OK.

The scenarios are imported into the work repository. They appear in the Scenarios tree of the Operator Navigator. If this work repository is a development repository, these scenario are also attached to their source Package, Interface, Procedure or Variable.

13.6.2 Replace a Scenario

Use the import replace mode if you want to replace a scenario with an exported one. To import a scenario in replace mode: 1. In Designer or Operator Navigator, select the scenario you wish to replace. 2. Right-click the scenario, and select Import Replace... 3. In the Replace Object dialog, specify the scenario export file.

4. Click OK.

13.6.3 Working with a Scenario from a Different Repository

A scenario may have to be operated from a different work repository than the one where it was generated. Examples Here are two examples of organizations that give rise to this type of process: