Page 1 of 1

Conditionnal run of a job

Posted: Mon Jan 22, 2007 12:16 pm
by bart12872
Hello,

I have a job I want to launch only if a certain file exist. So, i tried a wait for file in the before subroutine job but it doesn't work. The job statut is Aborted if the file is not present.
Do you have any suggestion on how to do this? I'm looking for a method not to complicated to implement because I have more than 10 jobs to launch by this way.

cheers,
bart.

Re: Conditionnal run of a job

Posted: Mon Jan 22, 2007 12:22 pm
by narasimha
bart12872 wrote:So, i tried a wait for file in the before subroutine job but it doesn't work.
Have you tried the "Wait-For-File Activity" sequence in the Job Sequence?
That should satisfy your needs.
If it does not help, get back.

Posted: Mon Jan 22, 2007 12:48 pm
by DSguru2B
Do you need to wait for file or just check if it exists or not? If the former then look into narasimha's suggestion. If the latter then search this forum. I posted a routine, a simple one, a while back that returns a true or a false for file presence and absence respectively.

Posted: Mon Jan 22, 2007 12:50 pm
by chulett
The WFF stage will do both, for the latter tell it to wait zero seconds and you get an existence check.

Posted: Mon Jan 22, 2007 12:50 pm
by DSguru2B
Doesnt it spit out a warning if file doesnt exist for the very same reason ?

Posted: Mon Jan 22, 2007 12:53 pm
by DSguru2B
Here's the routine I was talking about:
viewtopic.php?t=100401
Go to the second page. You can remove the timeout part if you want.

Posted: Mon Jan 22, 2007 1:57 pm
by chulett
DSguru2B wrote:Doesnt it spit out a warning if file doesnt exist for the very same reason ?
I believe that is a true statement. May or may not be an issue for folks, if so a quick "if -s" or other UNIX file check could easily be run in a Command stage. For Windows... [shrug]

Posted: Mon Jan 22, 2007 1:58 pm
by DSguru2B
For window, BASIC rules. You should be remembering the post that i embedded in my previous reply. You also posted lines of what was the Grand Father version of WFF stage.

Posted: Mon Jan 22, 2007 2:07 pm
by chulett
Yup, many moons ago I posted such. I checked your previous post and I found a korn waiting style script, didn't notice anything for Winders...

Posted: Mon Jan 22, 2007 2:10 pm
by DSguru2B
On the second page.