Compiling an External VBI Script


Just as you can record your interactions with the host and generate Java or C# code, you can generate VBI Script code, which can be compiled and then executed on the host. Using the VBI Script you can send and retrieve data from the host in a single trip.

You can modify the generated VBI Script outside of the designer or even create it from scratch. Whichever way the code is created, you must compile it to generate the final output that is sent to the host for execution. The code can be compiled in the designer or using a command line.

Compiling VBI Script in the Bridge Designer

  1. From the Bridge Designer Actions menu, click Compile External VBI Script to open the dialog box.
  2. Type or browse to the VBI Script file (.vbi) you want to compile. The file must adhere to the VBI Script specification to successfully compile. This is a required field.
  3. Type or browse to the location on the local file system where the generated files will be output. Generated files include the VBI Script binary file (.vbb) and the Java test class. You can also generate files that will expose the VBI Script as a SOAP or RESTFUL web service. This is a required field.
  4. Complete the optional fields as needed:
    This option Does this...
    Package name The package name used for the Java test class. If you do not specify a package name, the default package is used.
    Class name The class name of the Java test class. If you do not specify a class name, the class name will be the same as that used for the VBI Script.
    Inputs To specify inputs to the script, add them to the Inputs table. Inputs are keys(variables) and values in a Java map. The variable is the name of the variable defined in the script that is initialized with the string from the Values field during execution.
    • If you are not generating a Web service, inputs are optional. You can create them and pass them into the execute method when the program is run. However, if a variable\value pair is entered it may be considered a variable with a default value in the script.
    • If you plan on generating a Web service, you must define a variable for each input to the script. The values for each variable are given when the Web service is called.

    Click Add Row to specify as many inputs as needed.

    Web service Select Generate web service to expose the VBI Script as a web service.
    • Service name - The name of the service. If you do not specify a name, the service name will be the name used for the VBI Script.
    • Target namespace - The namespace used in the service. If you do not specify a namespace, the namespace defaults to urn:xmlns:<scriptname>
    • Jar name - The web service is saved as a JAR file to make it easier to deploy. If you do not specify a jar name, the name will be the script name and VBIScript appended to it.
    Persist settings Select this option to have everything you entered in this dialog box available the next time the dialog box is opened and the contents generated. If you do not persist the settings, then all the settings will return to their defaults and you will have to re-enter the path and output location of the script.
    Clear settings Click Clear settings to return all the settings in the dialog box to their defaults. This may be useful when you are compiling multiple scripts.
  5. Click Generate. The output of the dialog box is a compiled script a .vbb file. This is the file you will send to the host. It is the binary form of the script and what is executed on the host.

Compiling VBI Script using the command line

You can also compile a VBI Script outside of the designer, using a command line. The necessary files are located in VBIScriptCompiler.zip.

  1. Extract the zip file to a directory on your computer. The zip file contains all the required libraries and a command file to run the utility in the VBIScriptCompiler directory.
  2. Open a command window, change into the directory and run the command file. You will see the following options: command line options
  3. To display Help for the possible parameters, run the command file again using the -? option. The help is the same as that available from the Compile External VBI Script dialog box.

 

Related Topics
Bullet Bridge Designer Introduction
Bullet Creating a New Project