Scripting Jobs

From Obsidian Scheduler
Revision as of 16:28, 1 June 2013 by Craig (talk | contribs)
Jump to navigationJump to search

Obsidian provides support for execution of scripted jobs. None of these require any java code to be written. Scripts are set using the web admin application Jobs config.

  • com.carfey.ops.job.script.JavaScriptJob running Rhino
  • com.carfey.ops.job.script.PythonJob running Jython
  • com.carfey.ops.job.script.GroovyJob Groovy
  • com.carfey.ops.job.script.BeanShellJob executing a BeanShell script.
  • com.carfey.ops.job.script.SpringBeanJob is a convenience GroovyJob that does not require a script, using defined parameters to obtain the bean and invoke the method(s).
  • com.carfey.ops.job.script.ReflectiveJob is a convenience GroovyJob that does not require a script, using defined parameters to construct an object and invoke method(s), both supporting argument(s)
  • com.carfey.ops.job.script.ShellScriptJob is a convenience PythonJob that takes the content of a shell script, writes the script to disk, marks it executable and then executes it. Not supported on Windows-based platforms. As of Obsidian 2.0.
  • com.carfey.ops.job.script.ShellScriptExecutionJob is a convenience PythonJob that invokes a shell script. Not supported on Windows-based platforms. Validation of script existence and executable state is done only at runtime. You must ensure that the script exists in an executable state on all Obsidian Hosts in the cluster or restrict the job to the necessary Fixed Hosts. As of Obsidian 2.0.


Parameters

Any parameters configured for the job will be set as global-variables within the script. If a single value is configured for a parameter, it will be set as its direct type. If multiple values are set for a parameter, it will be passed into the script as a list of values.

Job Context

The job context variable is accessed through the global variable named "jobContext". This can be used to save output parameters, etc. See Job Results and Parameterization.

SpringBeanJob

A SpringBeanJob is simply a convenience GroovyJob with a predefined script that uses some specified parameters to find a Spring Bean and invoke specified method(s). Specify any optional class imports (class names only), the single line of code to retrieve the Spring Bean reference and the method name(s) to invoke.