Raise Error not aborting Project
Posted: Tue May 20, 2014 10:49 am
I have a project that will check for the presence of a file and loop until either the file is no longer there or it passes a threshold. If the file isn't there and the threshold is passed, then it should abort. But the Raise Error task is not aborting the Project. It's continuing past the Raise Error task and executing the other tasks.
Code: Select all
<project name="MFFileCheck_Loop_Iterate" mainModule="Main" version="2.0">
<description>For checking if a file exists on the mainframe</description>
<module name="Main" onError="setVariable:hdfound="FALSE"">
<setVariable label="hdfound" name="hdfound" value="TRUE" version="2.0" />
<setVariable label="MFFileName" name="MFFileName" value="T.CS.WH.SOA.HDDXFILE.DAT.UP" version="2.0" />
<doWhileLoop condition="${hdfound eq "TRUE"}" id="MFCheck" currentIterationVariable="threshold">
<ftp resourceId="MVS" outputSessionId="FTPSession" user="******" password="******" version="1.0" onError="setVariable:hdfound=FALSE">
<exec command="cwd 'ftintb01'" />
<list label="ListMFfiles" fileListVariable="filelist" numFilesFoundVariable="filecount">
<fileset dir="'${MFFileName}'" />
</list>
</ftp>
<delay label="Wait 10 Seconds" time="10" timeUnit="seconds" version="1.0" />
<exitLoop condition="${threshold ge 10}" loopId="MFCheck" />
</doWhileLoop>
<raiseError label="Threshold_Passed" version="1.0" executeOnlyIf="${threshold ge 10}">
<message>Threshold passed. Failing project</message>
</raiseError>
<ftp resourceId="MVS" inputSessionId="${FTPSession}" user="******" password="********" listParser="mvs" version="1.0">
<exec label="cwd 'ftintb01'" command="cwd 'ftintb01'" />
<list label="ListMFfiles" fileListVariable="hdfilelist" numFilesFoundVariable="hdfilecount">
<fileset dir="'${MFFileName}'" />
</list>
</ftp>
<ftpCloseSession label="Close FTP Session" sessionId="${FTPSession}" version="1.0" />
<if label="If File Does Not Exist" condition="${hdfound eq "FALSE"}">
<print label="File Not Found" version="1.0">
<![CDATA[FILE NOT FOUND]]>
</print>
</if>
<if label="If File Exists" condition="${hdfound eq "TRUE"}">
<print label="File Found" version="1.0">
<![CDATA[File ${MFFileName} found]]>
</print>
</if>
</module>
</project>