Dynamic selection using aliases > Script alias > Script alias example

Script alias example
In this example, a script alias is used to select the appropriate output connector:
spoolSWE – output connector used for invoices with country code SWE. This is also the default connector alternative.
spoolFIN – output connector used for invoices with country code FIN.
Key
The country code is used to determine which connector to select. In this example, the field reference &countryCode is used as key. This is a reference to the Event field countryCode.
Script
The script is a Before Message script that uses &countryCode to determine which connector to select, and sets the value of the alias variable $connector to the name of the selected connector.
//Select the appropriate output connector
if(&countryCode = "SWE")
{
   $connector = "spoolSWE";
}
if(&countryCode = "FIN")
{
   $connector = "spoolFIN";
}
Setting the alias
The alias is set in the Connector Selection Method dialog box.Click to enlarge
How it works
1
2
The field reference &countryCode in the current invoice equals SWE.
3
The Before Message script is run, and $connector is set to spoolSWE.
4
The connector alias is set to spoolSWE, and the invoice is sent to the connector spoolSWE.
OpenText StreamServe 5.6 Updated: 2013-03-01