AWS Thinkbox Discussion Forums

event plugin - JobFinished - RunManagedProcess

Hi,
I thought in an event plugin, I could import the Deadline.Plugins namespace and execute a “RunManagedProcess” within one of the events, such as OnJobFinished?
Annoyingly I should have tested this before writing the other class! Do I have any other options?
Thanks,
Mike

[code]import os
import clr
import sys

from System.IO import *
from System.Text import *
from System.Diagnostics import *
from System.Collections.Specialized import *
from System.Text.RegularExpressions import *

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

def GetDeadlineEventListener():
return eventPlugin()

class eventPlugin ( DeadlineEventListener ):

def OnJobFinished( self, job ):
        Process = AnotherClass( self.Executable, self.File )
        RunManagedProcess( Process )

class AnotherClass (ManagedProcess):
bla bla
arguments
exeuctable
etc…[/code]

Hey Mike,

You can use the RunProcess function:
thinkboxsoftware.com/deadlin … _Functions

Cheers,

  • Ryan

Hi,
Thanks, I thought this might be the case.
Could we consider allowing the Deadline.Plugins namespace to work in Event Plugins in the future?
Not sure how difficult/totally impossible this would be?
Mike

Hey Mike,

We could look into it in the future. There would be some refactoring involved to separate the RunManagedProcess stuff from the DeadlinePlugin code. I’ll add it to the wishlist.

Cheers,

  • Ryan

Cool. That would be useful!
I could then quite simply, copy and paste classes from a Deadline custom plugin that executes a simple ManagedProcess and re-use the code in an eventPlugin, whenever I need to stitch code together.
Thanks,
Mike

Privacy | Site terms | Cookie preferences