1
我正在與mqfte合作。是否有可能捕獲我在螞蟻腳本中使用的所有螞蟻任務的返回代碼?如何在ant腳本中獲取ant任務的返回碼?
我正在與mqfte合作。是否有可能捕獲我在螞蟻腳本中使用的所有螞蟻任務的返回代碼?如何在ant腳本中獲取ant任務的返回碼?
在FTE Ant作業中,每個步驟將有一個SuccessRC
規範。爲了繼續這一步,返回代碼必須成功。如果作業失敗,則會在日誌條目中報告失敗的返回碼。
例如,在以下作業中,源文件前調用在傳輸之前加密文件,如果傳輸成功,則源文件後調用將刪除文件的純文本版本。根據定義,如果傳輸失敗,非零返回碼將在FTE日誌中報告。否則,調用成功,我們知道返回碼全部爲零。
<request version="4.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FileTransfer.xsd">
<managedTransfer>
<originator>
<hostName>${hostName}</hostName>
<userID>${userID}</userID>
</originator>
<sourceAgent QMgr="${sourceQM}" agent="${sourceAgent}"/>
<destinationAgent QMgr="${destQM}" agent="${destAgent}"/>
<transferSet priority="5">
<metaDataSet>
<metaData key="Cost_Center">1234</metaData>
</metaDataSet>
<preSourceCall>
<command type="executable" name="/usr/bin/gpg" successRC="0">
<argument>-es</argument>
<argument>--batch</argument>
<argument>-r</argument>
<argument>${signame}</argument>
<argument>--output</argument>
<argument>${FILEPATH}.gpg</argument>
<argument>--passphrase-file</argument>
<argument>${pwdfile}</argument>
<argument>${FILEPATH}</argument>
</command>
</preSourceCall>
<postSourceCall>
<command type="executable" name="/var/IBM/WMQFTE/user/ant/rm" successRC="0">
<argument>${FILEPATH}</argument>
</command>
</postSourceCall>
<item checksumMethod="MD5" mode="binary">
<source disposition="delete" recursive="false">
<file>${FILEPATH}.gpg</file>
</source>
<destination exist="overwrite" type="directory">
<file>${targetDir}</file>
</destination>
</item>
</transferSet>
<job>
<name>gpge.xml</name>
</job>
</managedTransfer>
</request>
@Martin。屬性rcproperty不適用於所有的ant任務。除此之外,如何捕獲返回碼? – trilawney 2011-04-19 06:31:23