Executing a Scenario from an OS Command

You can launch a scenario from an operating system command.

To launch a scenario from an OS command:
  1. Launch a Shell (Unix), a Command Prompt (Windows) or a QSH session (AS/400)

  2. In this shell, launch the "startscen.bat" (on Windows) or startscen.sh (on Unix and AS/400) command.

Syntax: startscen <Name> <Version> <Context code> [<Log_Level>] [-SESSION_NAME=<session name>] [-KEYWORDS=<keywords>] [-NAME=<agent_name>] [-v=<trace level>] [<variable>=<value>]*

Warning: On Windows platforms, it is necessary to "delimit" the command arguments containing "=" signs or spaces, by using double quotes. The command call may differ from the Unix command call. For instance :
startscen.bat SCEN 001 GLOBAL "-v=5" "PROJ1.STATE=MICHIGAN"
(Windows)
./startscen.sh SCEN 001 GLOBAL -v=5 PROJ1.STATE=MICHIGAN
(Unix)

The table below lists the different parameters, both mandatory and optional. The parameters are preceded by the "-" character and the possible values are preceded by the "=" character. You must follow the character protection syntax specific to the operating system on which you enter the command.

 

Parameters

Description

<Name>

Name of the scenario (mandatory).

<Version>

Version of the scenario (mandatory). If the version specified is  -1, the last version of the scenario is executed.

<Context>

Execution context of the scenario (mandatory).

-v=<trace level>

 

Allows a trace to be displayed (verbose mode). There are five trace levels:

  1. Displays the start and end of each session

  2. Displays level 1 and the start and end of each step

  3. Displays level 2 and each task executed

  4. Displays the SQL queries executed, as well as level 4

  5. A complete trace, often requested during a support call

As some of these traces can be voluminous, it is recommended that you redirect them to a text file using the following command:

  • in Windows: "-v=5" > trace.txt

  • in Unix:   -v=5 > trace.txt

<Log_Level>

Defines the logging level for this scenario's execution. All the tasks whose logging level is lower than or equal to this value will be saved in the log at the end of execution. In the event of the interface ending abnormally, all tasks, regardless of this value, will be saved.

This parameter is in the format LEVEL<n> where <n> is the expected logging level, between 0 and 5. The default log level is 5.

Example : startscen.bat SCENAR 1 GLOBAL LEVEL5

-SESSION_NAME=<session_name>

Name of the session that will appear in the execution log.

-KEYWORDS=<keywords>

List of keywords attached to this session. These keywords make session identification easier. The list is a comma-separated list of keywords.

-NAME=<agent_name>

 

Agent name that will appear in the execution log for this session.

Caution: This agent name does not correspond to a logical or physical agent in the topology. This parameter does not enable to run a session on a remote agent. The SnpsStartScen API provides this feature.

<variable>=<value>

 

Allows one to assign a <value> to a <variable> for the execution of the scenario. <variable> is either a project or global variable. Project variables should be named <Project Code>.<Variable Name>. Global variables should be called GLOBAL.<variable Name>.

This parameter can be repeated to assign several variables.

Caution: Do not use a hash sign '#' to prefix the variable name on the startscen command line.

Work repository connection parameters

These parameters, which are used to specify the connection to the work repository, are specified in the file odiparams.

-SECU_DRIVER=<driver name>

JDBC driver to access the master repository.

For example:  oracle.jdbc.driver.OracleDriver

-SECU_URL=<url>

 

JDBC URL to access for the master repository.

For example:  jdbc:oracle:thin:@168.67.0.100:1522:ORCL

-SECU_USER=<user>

User for the master repository connection (the database user).

-SECU_PASS=<password>

Password for the master repository connection user. This password must be encrypted using the command agent ENCODE <password>.

-ODI_USER=<user>

Oracle Data Integrator User whose rights will be used to execute the scenario. If this user has no rights on the context for instance, the execution will not work. Default value: SUPERVISOR

-ODI_PASS=<password>

Password of the Oracle Data Integrator User. This password must be encrypted using the command agent ENCODE <password>.

- WORK_REPOSITORY=<work repository name>

Name of the work repository containing the scenarios to be executed.