Reset Submit Date on Requeue

Hi all,

I’d like to know if there is any way to reset the submit date/time of a job when I requeue a job through the deadline monitor. I know I can Resubmit a job and it will be reset, but this isn’t what I want. I got all the way through writing an event script before seeing in the documentation that ‘JobSubmitDateTime’ is a read only variable.

Has anyone got any ideas?

Cheers,

Adrian

You’re in luck! I just checked our code, and while the “JobSubmitDateTime” is indeed a read-only property of the Job class, the Job class also has another property called “SubmitDateTime” which isn’t :slight_smile:

So all your hard work on an Event Plugin shouldn’t be wasted!

Cheers,

  • Jon

Jon, thanks so much for your response. You are a life-saver!

For anyone interested, here is the event script I used to perform the task…


from System.IO import *
from System.Text import *
from System.DateTime import Now

from Deadline.Events import *
from Deadline.Scripting import *

######################################################################
## This is the function that Deadline calls to get an instance of the
## main DeadlineEventListener class.
######################################################################
def GetDeadlineEventListener():
	return MyEvent()

######################################################################
## This is the main DeadlineEventListener class for MyEvent.
######################################################################
class MyEvent (DeadlineEventListener):
	
	def OnJobRequeued( self, job ):

		currentTime = Now
		job.SubmitDateTime = currentTime
		RepositoryUtils.SaveJob(job)
				
		return

No problem, happy to help!

Cheers,

  • Jon