...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<job process_class="Agent_Windows" stop_on_error="no" order="yes">
<params >
<param name="name1" value="value1"/>
</params>
<script language="scriptcontrol:vbscript">
<![CDATA[
spooler_log.info( "id: " & spooler_task.order.id() )
spooler_log.info( "title: " & spooler_task.order.title() )
spooler_log.info( "state: " & spooler_task.order.state() )
spooler_log.info( "end state: " & spooler_task.order.end_state() )
Set jobChain = spooler_task.order.job_chain()
spooler_log.info( "job chain name: " & jobChain.name() )
spooler_task.order.set_state_text( "current state text" )
spooler_log.info( "state text: " & spooler_task.order.state_text() )
spooler_log.info( "next start time: " & spooler_task.order.string_next_start_time() )
spooler_log.info( "priority: " & spooler_task.order.priority() )
spooler_log.info( "suspended: " & spooler_task.order.suspended() )
spooler_log.info( "is Service: " & spooler.is_service() )
Set myJobChain = spooler_task.order.job_chain()
spooler_log.info( "job chain name: " & myJobChain.name() )
Set myParams = spooler_task.order.params()
spooler_log.info( "parameter name1=" & myParams.value( "name1" ) )
Set myVariables = spooler_task.order.params()
spooler_log.info( "params count: " & myVariables.count() )
myVariableNames = split( myVariables.names(), ";" )
For i = LBound(myVariableNames) to UBound(myVariableNames)
spooler_log.info( "variable " & myVariableNames(i) & ": " & spooler_task.order.params.var( myVariableNames(i) ) )
Next
spooler_log.info( "order xml: " & spooler_task.order.xml() )
]]>
</script>
<run_time />
</job> |
...
Example: VBScript Job with Job Chain API methods
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="ISO-8859-1"?> <job process_class="Agent_Windows" stop_on_error="no" order="yes" title="job_chain title" name="job_chain"> <params > <param name="name1" value="value1"/> </params> <script language="scriptcontrol:vbscript"> <![CDATA[ Set jobChain = spooler_task.order.job_chain() spooler_log.info( "name: " & jobChain.name() ) spooler_log.info( "path: " & jobChain.path() ) spooler_log.info( "title: " & jobChain.title() ) spooler_log.info( "orders recoverable: " & jobChain.orders_recoverable() ) spooler_log.info( "order count: " & jobChain.order_count() ) Set orderQueue = jobChain.order_queue( spooler_task.order.state() ) spooler_log.info( "order queue length: " & orderQueue.length() ) Set jobChainNode = jobChain.node( spooler_task.order.state() ) spooler_log.info( "job chain node job name: " & jobChainNode.job.name() ) ]]> </script> <run_time /> </job> |
...