...
- JobScheduler supports VBScript for implementation of jobs:
- support for VBScript with a Master is available since long
- support for ScriptControl:VBScript jobs with Agents is available with
Jira server SOS JIRA columns key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution serverId 6dc67751-9d67-34cd-985b-194a8cdc9602 key JS-1623
- The support for VBScript includes Shell jobs and API jobs:.that
- VBScript jobs can use objects, methods and properties of the JobScheduler API for VBScript
- ScriptControl:
- VBScript jobs can use the objects and methods of the JobScheduler API for ScriptControl:VBScript.
- Some minor differences exist between VBScript jobs for Master and Agents, see Compatibility between VBScript and ScriptControl:VBScript.
- VBScript jobs are configured language support is configured with
<script language="VBScript">
for execution with a Master<script language="ScriptControl:VBScript">
for execution with Agents.
...
- VBScript is a scripting language that is not developed any further.by Microsoft.
- The language is restricted to use of with 32bit architectures:
- In 64Bit environments VBScript can be executed from the command line by WoW64.
- JobScheduler in a 64Bit environment can execute VBScript scripts.
- However, VBScript is restricted to use of the 32Bit registry and can load classes that are registered for a 32Bit environment exlusivelyonly.
- In future releases JobScheduler Master will become available for 64Bit environments only and will therefore drop support for VBScript. JobScheduler Agents can be executed with 32Bit environments and 64Bit environments, the architecture in use is determined by the Java Virtual Machine (JVM) in use.
- Agents that are running with a JVM 32Bit (which is feasible within a 64Bit server architecture) integrate VBScript via the via ScriptControl.
- ScriptControl is available for 32Bit only.
- The intoduction of VBScript support for Agents offers a migration path for users of VBScript jobs:
- Jobs can be migrated from execution of with a Master to execution by with Agents.
- Migration requires
- to use the
<script language="ScriptControl:VBScript">
attribute for jobs. - to assign a process class to jobs or job chains that is assigned an Agent running with a 32Bit JVM.
- to adjust the VBScript syntax when using properties of the JobScheduler API, see Compatibility between VBScript and ScriptControl:VBScript.
- to use the
Feature Availability
Display feature availability | ||
---|---|---|
|
...
Example: Simple VBScript Job
Example 1: A simple VBScript job with some scripting similar to shell jobs might look like this:
...
Example: VBScript Job with Order API methods
Example 1: A simple VBScript job with some scripting similar to shell jobs might look like this:
...
Example: VBScript Job with Job Chain API methods
Example 1: A VBScript job with some scripting similar to shell jobs might look like this:
...
Anchor | ||||
---|---|---|---|---|
|
- Use of callback functions
- VBScript jobs are required to implement as a minimum the callback function
spooler_process()
. - ScriptControl:VBScript jobs can implement the
spooler_process()
function, however, they are not required to do so. Any script code that is added directly to the job script will implicitely be executed for a job step similar tospooler_process()
.
- VBScript jobs are required to implement as a minimum the callback function
- Use of the JobScheduler API
- VBScriipt jobs make use of objects, methods and properties of the JobScheduler API for VBScript.
- ScriptControl:VBScript jobs make use of objects and methods of the JobScheduler API for ScriptControl:VBScript
- Syntactical differences include
- With ScriptControl:VBScript no properties are available, instead the information can be accessed by methods:
- VBScript example:
spooler_task.id
- ScriptControl:VBScript example:
spooler_task.id()
- VBScript example:
- With ScriptControl:VBScript assignments to properties are replaced by methods:
- VBScript example:
spooler_job.max_order_setbacks = 2
- ScriptControl:VBScript example:
spooler_job.set_max_order_setbacks( 2 )
- VBScript example:
- With ScriptControl:VBScript assignments of more than one value to properties requires a
Call
statement:- VBScript example:
spooler_job.delay_after_error( 2 ) = 10 ' A 10 second delay after the 2nd consecutive error
- ScriptControl:VBScript example:
Call spooler_job.set_delay_after_error( 2, 10 ) ' A 10 second delay after the 2nd consecutive error
- VBScript example:
- Objects can be specified as methods:
- VBScript example:
spooler_task.order.params
- ScriptControl:VBScript example:
spooler_task.order.params
andspooler_task.order().params()
- VBScript example:
- With ScriptControl:VBScript no properties are available, instead the information can be accessed by methods: