Page 1 of 1

job to compile jobs

Posted: Fri Oct 27, 2006 4:07 am
by stivazzi
is it possible to write a job with a routine to compile other jobs?
how could i do that?
thanks for help

Posted: Fri Oct 27, 2006 4:26 am
by jhmckeever
If you're looking to compile numerous jobs in our go (say after a bulk import from a CMS into a testing environment) you could use the Multiple Job Compile tool in Manager.

If you're looking to reset aborted jobs (or somehow 'clean' your environment after a test/execution cycle) then you should investigate how the facilities available in routines might help you.

A quick search yields a posting with a title very similar to yours ...

viewtopic.php?t=100360&highlight=routine+compile+jobs

J. :-)

Posted: Fri Oct 27, 2006 6:26 am
by stivazzi
thanks and sorry... i read the thread... interesting!!
my problem now is: "where and how can i use this function?"

Posted: Fri Oct 27, 2006 7:55 am
by chulett
How about enlightening us with the 'why' behind the question... why do you think you need to do this?

Posted: Fri Oct 27, 2006 7:58 am
by ray.wurlod
You can use this function in job control code. But you don't have to; use a Job activity in a job sequence, set it to "Reset if required, then run", and the generated code will contain an appropriate call to DSPrepareJob.

However, note that the thread referred to does not provide any routine for compiling other jobs, because there isn't one. At least not one that uses publicly-available/documented routines. That's why there's a Multi Job Compile tool.

If you must hack, enable server side tracing then open a Manager client, then run Multi Job Compile. Disable server side tracing and close the Manager. Re-open the Manager (now with server side tracing disabled) and inspect the trace to see what got called. If you're really good you could replicate the code.

Posted: Fri Oct 27, 2006 7:59 am
by kcbland
I have such a job on my website Members Area. A job that compiles other jobs. As for a routine, the job control library there as well has compilation built into the job control function. So, you can get the logic from there or use as needed.

Posted: Mon Oct 30, 2006 3:12 am
by stivazzi
answering to chulett: why sould i do that?
because i have configured the sequence job with multiple instances option. But for each run of the job a new row appears in the director window. i'm afraid that after many runs this window could contain too many rows. Recompiling the job the rows related to the job disappear. i run this job by calling the web service (no interaction with DS client).
Someone suggested me to make a job to compile jobs.

thanks

Posted: Mon Oct 30, 2006 5:35 am
by Kirtikumar
I think a small code or script to clear the RT_STATUS files for the job could also be used. From the prev post, it seems it is RTI job and each time it is called, in status view of DS director it creates the multiple entries one for each instance.

If you are able to have script for that, it will do that clearing and no need to have routine or script to compile the jobs.

Posted: Mon Oct 30, 2006 6:39 am
by chulett
stivazzi wrote:answering to chulett: why sould i do that?
because i have configured the sequence job with multiple instances option.
Thanks. Sometimes people ask a specific question about how to do X and they don't mention they are trying to use that answer to solve problem Y... and X isn't the right answer. :wink:

You'll only end up with a number of entries in the Director view as you have unique Invocation IDs you've used to start the Sequence job in question. Hopefully you have the job that you need as Ken noted he has that (as well as other nifty stuff) available for free download from his website.

As to clearing the RT_STATUS files for the job, unfortunately that doesn't work. Keep in mind the fact that there really is only one STATUS 'file' here and each entry is just a 'view' into the base... ah, never mind. I was thinking you meant to clear the logs. I just experimented by doing a Clear Status File on an invocation entry and it does 'make it go away' interestingly enough. However, I'm not sure how to code something like that, if the mechanism is exposed via the API. Hmm...