How to connect to a remote domain within Smarts Adapter Scripting Language (Smarts ASL)
How to connect to multiple domains using Smarts ASL
In general, a single ASL cannot connect to multiple domains (see Note statement). Instead, each domain connection must have a separate ASL script. The following example shows how you could run an ASL script that connects to a second domain by invoking a second ASL script from within the first.
Example
You want to connect to two domains, AMPM-1 and AMPM-2. The first ASL script could be called myscript.asl which connects to AMPM-1 domain as follows:
<BASEDIR>/smarts/bin/sm_adapter -s AMPM-1 <myscript.asl>
To connect to the second domain (AMPM-2), you could invoke a different ASL script (myActions.asl) from within myscript.asl as follows:
myscript.asl
START { .. eol }
do {
ga_Driver = create("GA_Driver","gaDrive");
ga_RemoteServer = create("GA_RemoteServer","gaRemoteServer");
ga_RemoteServer->remoteServerName = "AMPM-2";
rs = create("GA_RuleSet", "gaRuleSet");
rs->fileName = "myActions.asl";
ga_Driver->ReadsRulesFrom = rs;
ga_Driver->SendsActionsTo = ga_RemoteServer;
ga_Driver->start();
}