fteAnt: run Ant tasks in MFT

The fteAnt command runs Ant scripts in an environment that has Managed File Transfer Ant tasks available. Unlike the standard ant command, fteAnt requires that you define a script file.


MFT Ant tasks and nested parameters

Managed File Transfer provides a number of Ant tasks that we can use to access file transfer capabilities. There is also a set of nested parameters available; these parameters describe nested sets of elements that are common across several of the supplied Ant tasks.

The fteAnt command syntax, parameters, usage example and return codes are described in the rest of this topic. For details of the Ant tasks and nested parameters that are provided by MFT, see the subtopics.


fteAnt syntax

fteAnt

fteAnt-d-debug-q-quiet-v-verbose-k-keep-going-Dproperty=value-propertyfile (name) -f (Ant script)-file (Ant script)-buildfile (Ant script)(targets)


Parameters

    -debug or -d
    Optional. Generate debugging output.

    -quiet or -q
    Optional. Generate minimal output.

    -verbose or -v
    Optional. Generate verbose output.

    -keep-going or -k
    Optional. Execute all targets that do not depend on failed targets.

    -D property=value
    Optional. Use value for a given property. Properties that are set with -D take precedence over those set in a properties file.

    Use the property com.ibm.wmqfte.propertyset to specify the set of configuration options that are used for Ant tasks. Use the name of a non-default coordination queue manager as the value for this property. Ant tasks then use the set of configuration options that are associated with this non-default coordination queue manager. If we do not specify this property, the default set of configuration options that are based on the default coordination queue manager is used. If you specify the cmdqm attribute for an Ant task, this attribute takes precedence over the set of configuration options that are specified for the fteAnt command. This behavior applies regardless of whether we are using the default set of configuration options or specifying a set with the com.ibm.wmqfte.propertyset property.

    -propertyfile (name)
    Optional. Load all properties from a file with -D properties taking precedence.

    -f (Ant script), -file (Ant script), or -buildfile (Ant script)
    Required. Specifies the name of the Ant script to run.

    targets
    Optional. The name of one or more targets to run from the Ant script. If we do not specify a value for this parameter, the default target for the script is run.

    -version
    Optional. Displays the Managed File Transfer command and Ant versions.

    -? or -h
    Optional. Displays command syntax.


Example

In this example, the target copy in Ant script fte_script.xml is run and the command writes debugging output to standard out.
fteAnt -d -f fte_script.xml copy


Return codes

    0
    Command completed successfully.

    1
    Command ended unsuccessfully.

Other status return codes can also be specified from Ant scripts, for example by using the Ant fail task.

  • fte:awaitoutcome Ant task
    Waits for a fte:filecopy, fte:filemove, or fte:call operation to complete.
  • fte:call Ant task
    We can use the fte:call task to remotely call scripts and programs.
  • fte:cancel Ant task
    Cancels a Managed File Transfer managed transfer or managed call. A managed transfer might have been created using the fte:filecopy or fte:filemove tasks. A managed call might have been created using the fte:call task.
  • fte:filecopy Ant task
    The fte:filecopy task copies files between Managed File Transfer agents. The file is not deleted from the source agent.
  • fte:filemove Ant task
    The fte:filemove task moves files between Managed File Transfer agents. When a file has been successfully transferred from the source agent to the destination agent, the file is deleted from the source agent.
  • fte:ignoreoutcome Ant task
    Ignore the outcome of an fte:filecopy, fte:filemove, or fte:call command. When you specify an fte:filecopy, fte:filemove, or fte:call task to have an outcome of defer, the Ant task allocates resources to tracking this outcome. If we are no longer interested in the outcome, we can use the fte:ignoreoutcome task to free those resources.
  • fte:ping Ant task
    This IBM WebSphere MQ File Transfer Edition Ant task pings an agent to elicit a response, and so determines if the agent is able to process transfers.
  • fte:uuid Ant task
    Generates a pseudo-random unique identifier and assigns it to a given IBM WebSphere MQ File Transfer Edition property. For example, we can use this identifier to generate job names for other file transfer operations.
  • fte:filespec Ant nested element
    The fte:filespec parameter is used as a nested element in other tasks. Use fte:filespec to describe a mapping between one or more source files, directories or data sets, and a destination. Typically this element is used when expressing a set of files or directories or data sets to move or copy.
  • fte:metadata Ant nested elements
    Metadata is used to carry additional user-defined information with a file transfer operation.
  • Program invocation nested elements
    Programs can be started using one of five nested elements: fte:presrc, fte:predst, fte:postdst, fte:postsrc, and fte:command. These nested elements instruct an agent to call an external program as part of its processing. Before we can start a program, we must ensure that the command is in a location specified by the commandPath property in the agent.properties file of the agent that runs the command.

Parent topic: Managed File Transfer developing applications reference


Related information