Reply To: fileset-local in run mode at process start

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf fileset-local in run mode at process start Reply To: fileset-local in run mode at process start

#59200
Greg Eriksen
Participant

    I found a solution to what I was trying to accomplish and thought I’d post it here in case I missed something obvious or better.  What I had wanted to do is have the directory parse tps proc check the local directory for a file the billing department was supposed to put there, and if it didn’t find it then raise an unholy stink about it and send out accusatory emails.  But if the proc was going to be executed in ‘run’ mode whenever the thread or process happened to be bounced, then it would falsely trigger the alerts at times the file was not supposed to be there.

    After my original post on this topic, I echoed some keylist commands to confirm that the proc arguments didn’t contain anything I could use to identify that the thread had just started.  I also put echo statements in each of the possible modes and learned that at startup the proc gets executed in BOTH ‘start’ mode and then ‘run’ mode.

    I thought about using an Alert to check for the file’s existence rather than the dirParse proc of the inbound fileset-local thread, but ‘file change’ just fills the log with errors that it can’t status a file that doesn’t exist, which doesn’t trigger the associated alert action proc.

    So, my solution was to global a variable called something like, “(proc_name)_startup”, and in the ‘start’ mode I set it to a value of “1”.  In the ‘run’ mode I have an if statement that when the variable is set on, it just sets it back to “0”, else it executes all the rest of the code I want to occur in the normal ‘run’ mode.  That way the first ‘run’ that occurs after a startup just sets the startup flag off.  And the subsequent ‘run’ that is triggered by the advanced scheduling performs the actions I only want to happen at that time.  This seems to work so far in testing, but that’s never quite the same as real life.