Job Processor Command Line Tricks

We are working on multiple fronts to address many of the Job Processor issues that people are running into.  For this post, I want to point out some command line features we added to Vault 2013.  This feature won’t fix all problems, but it has many uses.

You can read about the command line options from the SDK documentation or the wiki.  The idea behind these commands is to make JobProcessor behave more like a service.  You can now programmatically start, pause, resume, and gracefully shutdown.  Previously, start and kill were the only things you could do from a command line.

Here are a couple of uses I came up with for these new command line operations.  Feel free to post your ideas too in the comments section.

 

Make use of idle computers

When the CAD engineers go home for the night, use the idle computers to run Job Processor.  Create a Windows task that starts up Job Processor at 8 PM and shuts it down at 5 AM, for example.  If every CAD station does that every night, it should clear out any backups on the job queue.

 

Run certain jobs at certain times

Maybe you would rather not process DWF files during the daytime.  You can set things up so that DWF files only get processed at night.  The first step is to copy JobProcessor.exe.config.  Next edit the copy in an XML editor and comment out all the <jobHandler> elemets where the class attribute starts with “Autodesk.Vault.DWF.Create”.  This config will will be the one you use when you don’t want to handle DWF files.

Set up a Windows task that runs at 5 AM.  The task will shut down Job Processor, swap in the non-DWF config file, then re-start Job Processor.  Because the DWF <JobHandler> tags are commented out, it will not process DWF files.  Set up another task at 8 PM to shut down Job Processor, swap in the original config file, then re-start.

Here is an example BAT file for the 8 AM task.

cd C:\Program Files\Autodesk\Vault Professional 2013\Explorer

REM Send the stop command to Job Processor
JobProcessor /stop

REM Wait for Job Processor to exit
:RunCheck

tasklist /FI "IMAGENAME eq JobProcessor.exe" 2>NUL | find /I /N "JobProcessor.exe">NUL

if "%ERRORLEVEL%"=="0" goto RunCheck

REM swap in the non-DWF config file
xcopy JobProcessor.exe.noDwf.config JobProcessor.exe.config /Y

REM restart job processor
start JobProcessor

REM Job Processor should be running now and should be ignoring DWF jobs


Comments

11 responses to “Job Processor Command Line Tricks”

  1. Hi Doug.
    Is there any way to process only jobs logged by a certain user? If one of our engineers releases their document(s), we want to create a DWFx for the shop floor to view. Rather than have to process all other users releases, a particular engineer would want to process only their own files by running Job Processor locally, then check through to ensure updated details (such as revision) are correct on the DWFx.

  2. It sounds like you just want to create the DWF locally. In other words, you don’t care about the job queue itself, you just want to execute the DWF job handler?
    There is a trick you can do to execute a job handler without involving the job queue. Basically, you load the handler DLL directly and pass it a fake job. I think I’ll make this my next blog post, so stay tuned.
    To answer your original question, no, you can’t reserve jobs based on the user that queued the job.

  3. Mark Wigan Avatar
    Mark Wigan

    hi Doug,
    i am putting a simple batch file together which will start the job processor out of normal office hours. this works fine.
    i have one obstacle though for other functions…
    i wish to run a batch file for JobProcessor /pause or “stop” before the day shift resume however any of the 3 commands listed on wiki such as “stop”, “pause”, “resume” will not work.
    (a dedicated batch file will run one of those commands as i determine appropriate, if i can get it to work)…
    the batch file wil execute but error out stating that “job processor is already running”.”okay” (when you click okay the batch file exits without carrying out the command).
    i deployed the vault SDK thinking that perhaps there were missing DLL or handlers but after that i tested once more and they still do not run due to the same error.
    workstation being used is Windows7, on vault collaboration 2012, but still using update 1 for the adms & client. (do you think that could be the issue)

  4. Pause, Resume and Stop were added for Vault 2013. They are not in the 2012 release.

  5. Mark Wigan Avatar
    Mark Wigan

    i will be looking forward to seeing how to do this kind of dwf creation.

  6. kurt_esseltine@jayco.com Avatar
    kurt_esseltine@jayco.com

    so you have to go back and Re-submitt the jobs again ? or can you automate that process as well ? I get the same thing once its done and I try to restart to job processor it says it is already running ? and do I need to be worried about the files that have Error on them I seem to have allot of those that I have to resubmit to the job processor ?

  7. If you change the job processor settings, you shouldn’t have to re-submit any jobs.
    If jobs have errors, it means they were run and something went wrong. The error usually has something to do with the operation (for example, Inventor crashed when trying to generate a the DWF). The job processor settings won’t cause job failures.

  8. Jorn van Vliet Avatar
    Jorn van Vliet

    ” Next edit the copy in an XML editor and comment out all the elemets where the class attribute starts with “Autodesk.Vault.DWF.Create”. ” I don’t understand what you mean with comment out… Delete the row (from the job/element) in the copy JobProcessor.exe.config?? Is that what you mean?
    I want to run some jobs not on the working day and run these jobs in the night.
    I’m looking forward for your answer!

  9. You can delete the line if you want or you can comment it out by enclosing it in . Commenting it out has the same end effect as deleting it.
    You want to delete or comment entries. For example, if you want to disable DWF jobs for .iam files, your JobProcessor.exe.config would contain a line like this…
    <!– –>

  10. Marcelo Avatar
    Marcelo

    Hi, how can I clean out more than 1000 jobs from job processor queue? Is there a way to do it by prompt?
    like clean out 100000 jobs?

  11. By “clean out” you mean delete?
    No, you can’t delete jobs through a prompt. You would need to write a custom app to delete that many jobs.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading