Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • This example works for a JobScheduler Master 32bit and 64bit
  • The above COM component ComComponent.dll has to be registered for the respective architecture

 

Code Block
languagexml
titleMaster runs VBScript that calls a COM component
collapsetrue
<job  title="Master runs VBScript that calls a COM component" order="no" stop_on_error="no" tasks="1">
    <params/ >
    <script language="vbscript">
        <![CDATA[
        Set fso = CreateObject ("Scripting.FileSystemObject")
        Set stdout = fso.GetStandardStream (1)
        Set stderr = fso.GetStandardStream (2)
    
        dim objTest, intResult
        Set objTest = CreateObject ("ComComponent.ComClassExample")
        intResult = objTest.AddTheseUp (100, 200)
            
        stdout.WriteLine "running VB job: " & intResult
        ]]>
    </script>
    <run_time />
</job>

...

  • This example works for a 32bit Agent
  • The above COM component ComComponent.dll has to be registered for the 32bit architecture
  • Basically the job script is the same as for the Master, consider use of the language scriptcontrol:vbscript and the assignment of a process class that points to an Agent.

...

Code Block
languagexml
titleAgent runs VBScript that calls a COM component
collapsetrue
<job  title="Agent runs VBScript that calls a COM component" order="no" stop_on_error="no" tasks="1" process_class="Agent">
    <params />
    <script  language="scriptcontrol:vbscript">
        <![CDATA[
Set fso = CreateObject ("Scripting.FileSystemObject")
        Set stdout = fso.GetStandardStream (1)
        Set stderr = fso.GetStandardStream (2)
    
        dim objTest, intResult
        Set objTest = CreateObject ("ComComponent.ComClassExample")
        intResult = objTest.AddTheseUp (100, 200)
            
        stdout.WriteLine "running VB job: " & intResult
        ]]>
    </script>
    <run_time />
</job>

...

  • This example works for Agents 32bit and 64bit (depending on the JVM architecture in use)
  • The above COM component ComComponent.dll has to be registered for the respective architecture

...

Code Block
languagexml
titleAgent runs PowerShell that calls a COM component
collapsetrue
<job  title="Agent runs PowerShell that calls a COM component" order="no" stop_on_error="no" tasks="1" process_class="Agent">
    <params />
    <script  language="powershell">
        <![CDATA[
$objTest = New-Object -ComObject "ComComponent.ComClassExample"
$intResult = $objTest.AddTheseUp(100, 200)
            
echo "running PowerShell job: $intResult"
        ]]>
    </script>
    <run_time />
</job>

...