Scripting Tutorial

In this section:

This section provides scripting tutorials for iWay Integration Application (iIA).


Top of page

x
Remote Ant Script Invocation

The scripting tutorial in this section focuses on the advanced use of iIA, which includes altering the current iWay installation.

The following procedure develops an Ant script that creates a backup directory under the iWay Home directory. The script will be added to an application as a file resource and then invoke the remote Ant script using the iwscript iWay Ant task.



x
Procedure: How to Invoke an Ant Script Remotely

To invoke an Ant script remotely:

  1. Create a new Integration Project and open the XML editor.

    The new XML file wizard is located under the XML section, as shown in the following image.

    After opening the XML file and writing the project XML tag, the XML editor will be replaced with the Ant editor. The remote Ant file is shown in the following image.

    The Ant file has one target in it, the mkdir. It uses the environment variable on the remote machine to find the iWay home directory and creates a backup directory there.

  2. Create a new application and add the remote.xml file to it as a file resource, as shown in the following image.

  3. Save the application.
  4. Modify the local build.xml file to call the remote Ant target on remote.xml. You can also add a do_all target to perform undeploy, build, upload, deploy, and remote script invocations in order, as shown in the following image.

  5. Execute the new do_all target, as shown below.

    The following execution log is produced.

    Notice that the successful creation of a new backup directory on the remote machine was reported. It results in a permanent change of the iWay installation, which will be in effect even if the entire Ant application is deleted.

    Note: Because of how powerful the remote Ant script invocation feature can be, it has to be used carefully, with awareness of the possibility to produce irreversible changes to your environment.


Top of page

x
Multi-server Deployment Using the Ant Script

This section describes how to add new targets to the Ant script, which will contain the following tasks:

The following sample syntax contains the exact snippets of these additional targets:

Note that the user name and password are assumed to be the same across the enterprise installations of iWay. If that was not the case, the above script would have increased complexity to it.

Running the script produces a trace similar to the following:

The application and the template were uploaded and deployed together on both servers.


iWay Software