AWS Thinkbox Discussion Forums

JobBatchName setter doesn't work

Using deadline 9.
I noticed in a very simple Event script I made which sets the JobBatchName on Submission doesn’t appear to actually do anything. I even tried to set the BatchName on JobFinished and it still appears to do nothing. Is there something I’m doing wrong here?

You’ll notice in the code below that it prints out the correct JobBatchName after i’ve modified it, however it doesn’t update in the UI when i open the Modifier Job Properties panel, and most importantly it doesn’t update the Grouping filter in monitor. That is the whole reason I’m looking to modifier the JobBatchName on submission. Hope this is something we can resolve. Thank you

################################################################################
#  Imports
################################################################################
from System.Diagnostics import *
from System.IO import *

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

################################################################################
# Give Deadline an instance of this class so it can use it.
################################################################################
def GetDeadlineEventListener():
    return MyEvent()

################################################################################
# Cleans up deadline event when it's no longer in use
################################################################################
def CleanupDeadlineEventListener(eventListener):
    eventListener.Cleanup()

################################################################################
# The Stats event listener class.
################################################################################
class MyEvent (DeadlineEventListener):

    def __init__( self ):
        self.OnJobFinishedCallback += self.OnJobFinished

    def Cleanup( self ):
        del self.OnJobFinishedCallback
            
    # This is called when the job finishes rendering.
    def OnJobFinished(self, job):
        self.LogInfo('---Job Statistics---')
        self.LogInfo('UserName: ' + str(job.UserName))
        self.LogInfo('JobID: ' + str(job.JobId))
        self.LogInfo('JobPlugin: ' + str(job.JobPlugin))
        self.LogInfo('JobName: ' + str(job.JobName))
        self.LogInfo('JobBatchName: ' + str(job.JobBatchName))

        job.JobBatchName = 'Candle'

        self.LogInfo('Updated JobBatchName: ' + str(job.JobBatchName))
        pass

In case anyone else is having issues here is the solution. call this after you modify job properties

RepositoryUtils.SaveJob(job)

That bites me all the time too. :slight_smile:

Privacy | Site terms | Cookie preferences