RunCommands Statement

Added: build 1

Purpose

Specifies the actions to perform when the component is executed. As of build 165, there may be more than one RunCommands section within a FileWrapper file.

Syntax

RunCommands [name]
{
   <statements>
   ...
}

Arguments

Name Description
name The name argument is optional. If a name is not specified, it defaults to "execute." Most FileWrapper components will only have one, unnamed RunCommands section. You may want to define additional sections to initialize and cleanup the component, and/or provide methods that may be invoked on demand (see the listMethods and invoke commands).

If any of the following names are used, then a corresponding special action occurs:

  • initialize - These actions will automatically be performed when the component is first started.
  • execute - These actions will automatically be performed when the component is executed.
  • halt - These actions will be called if the connection to the Analysis Server is lost while the component is executing. If this is method is NOT defined and the connection is broken, the currently executing command will be killed.
  • end - These actions will automatically be performed when the component is terminated.
If one of the special names is used, it will not be displayed when the listMethods command is issued. The method may, however, still be invoked using the invoke command.

Applicable Statements

The following statements are valid within a RunCommands section. Notes:

Example

The following set of commands instructs the FileWrapper to generate an input file, run "myProg.exe", and then parse the resulting output file.
RunCommands
{ 
   generate inFile
   run "myProg.exe inFile.dat outFile.dat"
   parse outFile
}
The following example runs the same program used in the previous example, and cleans up temporary files generated by the program when it runs.
RunCommands
{ 
   generate inFile
   run "myProg.exe inFile.dat outFile.dat"
   parse outFile
}

RunCommands end
{
   run "rm *.tmp"
}

See also Analysis Server | FileWrapper | FileWrapper Statements