Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UpdateJobFailure - Error 160

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
FarrenYoung
634 Views, 3 Replies

UpdateJobFailure - Error 160

I am trying to manually update a job status in vault 2012 professional.  Is this possible?  I tried the method UpdateJobFailure, but get error 160.

 

My plan is to be able to change a job from Ready to Paused and then later change the Paused job back to Ready by resubmitting it.  I have the code working to resubmit it, but how can I cancel a job that is in the Ready state without the job prcessor actually picking it up and erroring it out?

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
3 REPLIES 3
Message 2 of 4
Redmond.D
in reply to: FarrenYoung

I'm not exactly sure what you mean when you say that you want to "change a job from Ready to Paused"

Jobs don't have a "Paused" state.  Looking at the JobStatus enum in the SDK documentation, the states are Failure, Ready, Running, Success.

 

If you want to move a job from Ready to Running, you call ReserveNextJob.  If you want to move the job back to Ready, call UnReserveJobById.  I you want to move a Ready job off the queue, you can either call DeleteJobById or you can reserve it and call UpdateJobSuccess.

 

It seems that you want to get these jobs before Job Processor gets them.  The way that the job queue works is that a job gets reserved to the first client that requests a job of that type.  So there is no way to guarantee that your app will always get the job first.

 

Maybe you could elaborate what problem you are trying to solve.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 4
FarrenYoung
in reply to: Redmond.D

I was just trying to manually "Fail" a job. 

I wrote my own job queue manager and one of the features I wanted was to "Pause" a job (prior to it ever running) so that the job processor would not pick it up.  "Resuming" a paused job is done by Re-submitting it.  It seems like I was just missing the ReserveNextJob bit as it's working after adding that.

 

                    JobSvc.ReserveNextJob(New String() {job.Typ}, System.Environment.UserName)
JobSvc.UpdateJobFailure(job.Id, "User canceled job")

You might consider mentioning in the api help that a job needs to be reserved prior to updating the job failure.

 

Thanks for your help.

 

 

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 4 of 4
FarrenYoung
in reply to: Redmond.D

I missed the bit about unreserving to set it back to ready.  I will use that instead of re-submitting.

 

Thanks again.

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report