Page 1 of 1

Set job status to "not compiled"

Posted: Tue Apr 12, 2005 3:01 am
by Joshi
Hello,

we have a very long chain of sequences and sometimes we need to interrupt this chain. To do this, we set the job status of a job to "not compiled". For the time being, this is done by compiling the job with an error. Is there a way to do this by a routine?

Regards,

Joshi.

Posted: Tue Apr 12, 2005 4:46 am
by roy
Hi,
IMHO, your method is crashing the process and thus not a desirable solution.

I prefer using stop from director;
Or putting check-points in your flow that select a value from a control table, If it is set to continue the flow continues, otherwise it logs the event + send notifications and finishes.

in this way when you want to stop the ong flow you simply update the value in the control table and it will stop in an orderly mannor at the first next check point you have.

P.S:
I'm not sure if version 6 has the DSStopJob, if it does you can use it to stop the job.

IHTH,

Posted: Tue Apr 12, 2005 7:06 am
by chulett
Joshi - that's an... interesting... solution. Not something I would have thought of, mostly because our Production jobs are read only and can't be horked with like that. :wink:

Suggest you build checkpoints into the process, much like Roy mentions. I've taken more of an approach in the past of assinging a directory as a 'polling' directory and then having a routine that can look in that directory for certain flag files. Find a flag and issue an abort or whatever else seems appropriate at the time. Sprinkle them in the job chain. Then all you need to do is create the appropriate flag file (no records in it, just the file itself) and things will wind down.

Food for thought...

Posted: Tue Apr 12, 2005 9:28 am
by kduke
DSStopJob was available in version 5

Code: Select all

 $INCLUDE DSINCLUDE JOBCONTROL.H
     RunHandle = DSAttachJob(JobName, DSJ.ERRNONE)
            JStat = DSStopJob(RunHandle)
      JStat = DSDetachJob(RunHandle)
Here are 3 lines of code to do it. There was lots of code in between to make sure the job was running and I attached properly but this should get you close.

Posted: Tue Apr 12, 2005 2:53 pm
by ray.wurlod
Insert some other Activities to give you the control. Use Routine, Execute Command or Nested Condition Activities - you can effect your control with any of them. For example, an Execute Command activity could test for the existence of a file (you could even use a Wait For File activity here).