Create a task definition document by modifying a generated document
We can create the monitor task definition document by modifying the XML document generated by the -gt option of fteCreateTransfer.
About this task
The generated document has a <request> followed by <managedTransfer> element. To convert this task definition to a valid <managedCall> structure, follow these steps:
Procedure
- Replace the <managedTransfer> start and end tags with <managedCall> tags.
- Remove any <schedule> element and child nodes.
- Replace the <sourceAgent> start and end tags with <agent> to match the monitoring agent configuration details.
- Remove <destinationAgent> and <trigger> elements.
- Remove <item> elements.
- Insert a new <call>...</call> structure within the <transferSet> element. This structure contains the command definition as shown in the following example:
<call> <command name="RunCleanup.xml" type="antscript" retryCount="2" retryWait="30" successRC="0"> <target>check_exists</target> <target>copy_to_archive</target> <target>rename_temps</target> <target>delete_files</target> <property name="trigger.filename" value="${FileName}"/> <property name="trigger.path" value="${FilePath}"/> </command> </call>
Example
We can also retain the <managedTransfer> element including all the file transfer details, and insert up to four command calls. In this case you insert any selection of the following call elements between the <metaDataSet> and <item> elements:
- preSourceCall
- Call a program on the source agent before starting the transfer.
- postSourceCall
- Call a program on the source agent after completing the transfer.
- preDestinationCall
- Call a program on the destination agent before starting the transfer.
- postDestinationCall
- Call a program on the destination agent after completing the transfer.
Each of these elements takes the <command> element structure as described in the earlier example. The FileTransfer.xsd schema defines the types used by the various call elements.
The following example shows preSourceCall, postSourceCall, preDestinationCall, and postDestinationCall in a task definition document:
⋮ <transferSet priority="1"> <metaDataSet> <metaData key="key1">value1</metaData> </metaDataSet> <preSourceCall> <command name="send.exe" retryCount="0" retryWait="0" successRC="0" type="executable"> <argument>report1.pdf</argument> <argument>true</argument> </command> </preSourceCall> <postSourceCall> <command name="//DO_IT.JCL" retryCount="0" retryWait="0" successRC="0" type="jcl"> <argument>argument</argument> </command> </postSourceCall> <preDestinationCall> <command name="ant_script.xml" retryCount="0" retryWait="0" successRC="0" type="antscript"> <target>step1</target> <property name="name" value="value"/> </command> </preDestinationCall> <postDestinationCall> <command name="runit.cmd" retryCount="0" retryWait="0" successRC="0" /> </postDestinationCall> <item checksumMethod="none" mode="binary"> ⋮You can mix different types of command into the transfer. Argument, target, and property elements are optional. Parent topic: Configure MFT monitor tasks to start commands and scripts