Configuring the Script adapter

Adapter type: ro-adapter-script_vv.rr.nn

Default adapter name: ScriptAdapter

To configure the Script adapter, see Configuring base adapters.

The following table describes the adapter configuration elements for the Script adapter that you can specify by using the form view, XML view, or both. You cannot use the form view to configure elements and attributes that do not have an entry in the "UI label" column.


Configuration node elements for the Script adapter

UI label

Element

Description

Required

Perl Path

<perl-path>

Specifies the fully qualified (absolute and unambiguous) path to the Perl executable

Yes

Handle Script Error

<handle-script-error>

Specifies whether to handle or ignore internal script errors when using script activity

If you set <handle-script-error> to true, the adapter returns empty values in the adapter response if there are incorrect inputs in the scripts.

Valid values: true, false (default)

No

Character Set

<character-set>

Specifies the supporting CharSet (also called character set)

It includes identifiers describing a series of universal characters.

You can get the active code page supported by cmd.exe by running the chcp command on the target Command Line client.

Notes

To get the expected results:

  • Ensure that the locale and character set of the target computer or peer where the adapter is enabled are compatible with the locale and the character set configured in the <character-set> element.
  • Perform some additional system settings.
  • If the script contains non-English characters, ensure to save the script in the corresponding encoding format to avoid getting a NullPointerException error message.
    For example, if you set <character-set> to 'Windows-1256' to support the Arabic language, ensure to save the script in an UTF-8 format without byte order mark (BOM).

Valid values:

  • GB18030
  • UTF-8
  • SHIFT_JIS
  • BIG5

No

System settings for the Language Enablement (LE) feature

  1. Click Start > Control Panel.
  2. Double-click Regional and Language Options.
  3. Click the Regional Options tab, select a regional standard (for example, Chinese PRC), and then click Apply.
  4. Click the Advanced tab and select the same regional standard (for example, Chinese PRC) that you selected in Step 2.
  5. Select the check box under Default user account settings.
  6. Click Apply, and then click OK.
  7. Restart your computer.

    The following figure shows an XML template for the Script adapter configuration.

    XML template of the Script adapter configuration

    <config>
       <perl-path></perl-path>
       <handle-script-error></handle-script-error>
    </config>

    The following figure shows an XML sample for the Script adapter configuration.

    XML sample of the Script adapter configuration

    <config>
         <perl-path>c:/Perl/bin/perl.exe</perl-path>
         <handle-script-error>true</handle-script-error>
    </config>

    The following figure shows an XML sample for the Script adapter configuration when the adapter supports Language Enablement (LE) and uses Jython (version 2.2.1) scripts.

    XML sample of the Script adapter configuration when the adapter supports LE and uses Jython scripts

    <config>
      <perl-path>C:\jython2.2.1\jython.jar</perl-path> 
      <handle-script-error>true</handle-script-error> 
      <character-set>GB18030</character-set> 
    </config> 

    The following figure shows an XML sample for the Script adapter configuration when the adapter supports LE and uses Perl(version 5.14.2) scripts.

    XML sample of the Script adapter configuration when the adapter supports LE and uses Perl scripts

    <config>
      <perl-path>C:\Perl\bin\perl.exe</perl-path> 
      <handle-script-error>true</handle-script-error> 
      <character-set>GB18030</character-set> 
    </config> 
Was this page helpful? Yes No Submitting... Thank you

Comments