Specifying programs to run

You can run programs on a system where a IBM® WebSphere® MQ Managed File Transfer agent is running. As part of a file transfer request, you can specify a program to run either before a transfer starts, or after it finishes. Additionally, you can start a program that is not part of a file transfer request by submitting a managed call request.

There are five scenarios in which you can specify a program to run:
  • As part of a transfer request, at the source agent, before the transfer starts
  • As part of a transfer request, at the destination agent, before the transfer starts
  • As part of a transfer request, at the source agent, after the transfer completes
  • As part of a transfer request, at the destination agent, after the transfer completes
  • Not as part of a transfer request. You can submit a request to an agent to run a program. This scenario is sometimes referred to as a managed call.
There are several ways to specify a program that you want to run. These options are as follows:
Use an Apache Ant task

Use one of the fte:filecopy, fte:filemove, and fte:call Ant tasks to start a program. Using an Ant task, you can specify a program in any of the five scenarios, using the fte:presrc, fte:predst, fte:postdst, fte:postsrc, and fte:command nested elements. For more information, see Program invocation nested elements.

Edit the file transfer request message

You can edit the XML that is generated by a transfer request. Using this method, you can run a program in any of the five scenarios, by adding preSourceCall, postSourceCall, preDestinationCall, postDestinationCall, and managedCall elements to the XML file. Then, use this modified XML file as the transfer definition for a new file transfer request, for example with the fteCreateTransfer -td parameter. For more information, see Call request message examples.

Use the fteCreateTransfer command

You can use the fteCreateTransfer command to specify programs to start. You can use the command to specify programs to run in the first four scenarios, as part of a transfer request, but you cannot start a managed call. For information about the parameters to use, see fteCreateTransfer (create new file transfer). For examples of using this command, see Examples of using fteCreateTransfer to start programs.

Use the Web Gateway

If you have configured a Web Gateway, you can run programs at the destination agent after the transfer has completed. You cannot use this method to submit a managed call request, or to run programs at the source agent, or at the destination agent before the transfer starts. Specify the x-fte-postdest header or use the postdest form field in the HTTP request. For more information, see HTTP headers and HTML form fields for using the Web Gateway.