Slightly More Difficult Job Creation

emailrhoads (5 posts)
July 17, 2009 02:18 PM
Accepted Answer

Hello All,

 I am trying to create something that will read values from a csv or txt file and then use these values as input parameters for Job Creation.  I am using VB Express 2008.

 I am running into difficulties in the following areas:

1. I want to pass command line parameters for the scheduled .exe file to be run and I do not see how to do this in the API documentation.  The program exection area of the online documentation is down.

2. I would like to notify via email if the job fails.  I cannot get the GetRecipients method to work.

3. I would like the job to only run on certain days, but the dayintervalcriterion documentation link is broken.

Any help?  I have my code that works without these 3 needs to post if necessary.


Bill Staff (599 posts)
July 20, 2009 10:54 AM
Accepted Answer
If you are using the online version of the API documentation, all the links are working as far as I can tell. If you are using the downloaded help file version you may need to "unblock" the file as described in the instructions on the download page.

The command line parameters are set in the CommandLineParameters property of the ProgramExecutionTask.

In what way is the GetRecipient method not working?

DayIntervalCriterion will let you run the job every x days. If you want to select specific days (e.g., Monday and Thursday), you need to use a SpecifyDaysCriterion and add DaySpecifications to it.


emailrhoads (5 posts)
July 21, 2009 12:08 PM
Accepted Answer

When I run my code I get the following error:

 

Unhandled Exception: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'ADTempus.NotificationAddress'. Thisoperation failed because the QueryInterface call on the COM component for the interface with IID '{FEDEBBEB-F23A-4D7A-A7B3-B833C2E0E48C}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).   at ConsoleApplication1.AdTempusAPI.Module1.GetRecipient(String emailAddress,scheduler theScheduler) in C:\my_data\Visual Studio 2008\Projects\AdTempus API\AdTempus API\Module1.vb:line 221   at ConsoleApplication1.AdTempusAPI.Module1.Main() in C:\my_data\Visual Studio 2008\Projects\AdTempus API\AdTempus API\Module1.vb:line 110Press any key to continue . . .

 

 

Line 110 in my code is:

recipient = GetRecipient("Test User", theScheduler)

 

If I do not comment out theresponse.Actions.Add(thenotificationaction) it fails here

 

I have attached the code I am using.

                progex.SuccessCriterion = SuccessCriterionEnum.scExitCode 
                'success is indicated by an exit code <= 4 
                progex.ExitCodeCriterion = ExitCodeTestTypeEnum.exitCodeLE 
                progex.SuccessMinCode = 4 
 
                'if the task fails, we want to retry it. 
                'create the response 
                theresponse = theScheduler.CreateObject(ClassIDEnum.CID_Response) 
 
                'create an event filter to trigger the response when the step fails() 
                eventFilter = theScheduler.CreateObject(ClassIDEnum.CID_JobEventFilter) 
                eventFilter.Event = JobEventEnum.jeStepFailed 
                theresponse.Events.Add(eventFilter) 
 
                'now the action to restart 
                restartAction = theScheduler.CreateObject(ClassIDEnum.CID_JobControlAction) 
                restartAction.ControlType = JobControlActionsEnum.jcaRestartStep 
                restartAction.RestartDelay = 120 'wait 120 seconds (=2 minutes) before trying again() 
                restartAction.RetryLimit = 4 'retry up to 4 times 
 
                'theresponse.Actions.Add(thenotificationaction) 
                step1.Responses.Add(theresponse) 
 
                'we want to send e-mail notification if the task still doesn't succeed after the 4 retries. 
                'first create the recipient. This method will retrieve the existing 
                'recipient object if one exists, or create a new one if necessary 
 
                recipient = GetRecipient("Test User", theScheduler) 
 
                'create another response 
                newresponse = theScheduler.CreateObject(ClassIDEnum.CID_Response) 
 
                'create an event filter to trigger the response when the restart limit Is exceeded 
                eventFilter = theScheduler.CreateObject(ClassIDEnum.CID_JobEventFilter) 
                eventFilter.Event = JobEventEnum.jeRestartLimitExceeded 
                newresponse.Events.Add(eventFilter) 
 
                'create the action to send the notification 
                thenotificationaction = theScheduler.CreateObject(ClassIDEnum.CID_NotificationAction) 
                thenotificationaction.Recipients.Add(recipient) 
                'we'll use the default subject and message, so we don't need to do anything else with the action 
 
 
 
                newresponse.Actions.Add(thenotificationaction) 
                step1.Responses.Add(newresponse) 
 
Bill Staff (599 posts)
July 21, 2009 12:46 PM
Accepted Answer

Where is your code for GetRecipient? That's where the failure is occurring (line 221 in module1.vb). Are you using the sample code from the API doc, or something else?

The line you have commented out is adding thenotificationaction before you have created that object. I think you mean for that line to be adding restartAction. You have another line further down where you add thenotificationaction after you have created it and set its properties.


emailrhoads (5 posts)
July 22, 2009 08:24 AM
Accepted Answer

Here is my full code:
Imports ADTempus 
Imports System.IO 
 
 
Namespace AdTempusAPI 
 
 
    Module Module1 
 
        Sub Main() 
 
            'Dim dayspecs As DaySpecification 
            Dim jobTime As Date 
            Dim theScheduler As scheduler 
            Dim theApp As Application 
            Dim job1 As Job 
            Dim step1 As JobStep 
            Dim progex As ProgramExecutionTask 
            Dim trigger As ScheduleTrigger 
            Dim schedule1 As Schedule 
            Dim dateschedule1 As DateSchedule 
            Dim timecriterion As SpecifyTimeCriterion 
            'Dim daycriterion As SpecifyDaysCriterion 
            Dim datecriterion As DayIntervalCriterion 
            Dim theresponse As Response 
            Dim newresponse As Response 
            Dim eventFilter As JobEventFilter 
            Dim thenotificationaction As NotificationAction 
            Dim recipient As NotificationAddress 
            Dim restartAction As JobControlAction 
 
 
 
 
 
            'Dim errors As ArcanaDevelopment.ADErrorHandling.ADErrors 
            'Dim errorSeverity As ADErrorSeverity 
 
            ' Loop through each line in array returned by ReadAllLines 
            Dim line As String 
            For Each line In File.ReadAllLines("C:\inputs.csv") 
 
                ' Split line on comma 
                Dim jobLine As String() = line.Split(New Char() {","c}) 
 
 
                Dim ipv As IProvideValidation 
                'create an application object 
                theApp = New Application 
 
                'create a new session using native Windows security 
                theScheduler = theApp.Connect("", "") 
 
                'Data objects (objects derived from IADTObject) cannot be directly created. 
                'They must be created through a call to scheduler.CreateObject() 
                job1 = theScheduler.CreateObject(ClassIDEnum.CID_Job) 
 
                job1.Name = jobLine(0) 
 
                'replace with the appropriate credentials 
                job1.UserID = jobLine(1) 
                job1.Password = jobLine(2) 
 
                'we'll use the defaults for all other Job properties 
 
 
                'next we need a step 
                step1 = theScheduler.CreateObject(ClassIDEnum.CID_JobStep) 
 
                'and a task. Use a ProgramExecutionTask to run a program 
                progex = theScheduler.CreateObject(ClassIDEnum.CID_ProgramExecutionTask) 
 
                'we'll run Notepad.exe (%windir% will be expanded by adTempus 
                'to the value of the WINDIR environment variable) 
                progex.ExecutionTarget = jobLine(3) 
                progex.CommandLineParameters = jobLine(4) 
                progex.WindowMode = WindowModeEnum.wmNormal 'we want it to be visible 
 
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
                '*************************************************************************************************************** 
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
                'we want to look at the exit code to determine success 
                progex.SuccessCriterion = SuccessCriterionEnum.scExitCode 
                'success is indicated by an exit code <= 4 
                progex.ExitCodeCriterion = ExitCodeTestTypeEnum.exitCodeLE 
                progex.SuccessMinCode = 4 
 
                'if the task fails, we want to retry it. 
                'create the response 
                theresponse = theScheduler.CreateObject(ClassIDEnum.CID_Response) 
 
                'create an event filter to trigger the response when the step fails() 
                eventFilter = theScheduler.CreateObject(ClassIDEnum.CID_JobEventFilter) 
                eventFilter.Event = JobEventEnum.jeStepFailed 
                theresponse.Events.Add(eventFilter) 
 
                'now the action to restart 
                restartAction = theScheduler.CreateObject(ClassIDEnum.CID_JobControlAction) 
                restartAction.ControlType = JobControlActionsEnum.jcaRestartStep 
                restartAction.RestartDelay = 120 'wait 120 seconds (=2 minutes) before trying again() 
                restartAction.RetryLimit = 4 'retry up to 4 times 
 
                theresponse.Actions.Add(thenotificationaction) 
                step1.Responses.Add(theresponse) 
 
                'we want to send e-mail notification if the task still doesn't succeed after the 4 retries. 
                'first create the recipient. This method will retrieve the existing 
                'recipient object if one exists, or create a new one if necessary 
 
                recipient = GetRecipient("Test User", theScheduler) 
 
                'create another response 
                newresponse = theScheduler.CreateObject(ClassIDEnum.CID_Response) 
 
                'create an event filter to trigger the response when the restart limit Is exceeded 
                eventFilter = theScheduler.CreateObject(ClassIDEnum.CID_JobEventFilter) 
                eventFilter.Event = JobEventEnum.jeRestartLimitExceeded 
                newresponse.Events.Add(eventFilter) 
 
                'create the action to send the notification 
                thenotificationaction = theScheduler.CreateObject(ClassIDEnum.CID_NotificationAction) 
                thenotificationaction.Recipients.Add(recipient) 
                'we'll use the default subject and message, so we don't need to do anything else with the action 
 
 
 
                newresponse.Actions.Add(thenotificationaction) 
                step1.Responses.Add(newresponse) 
 
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
                '*************************************************************************************************************** 
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
 
                'assign the task to the step 
                step1.Task = progex 
 
                'add the step to the job 
                job1.Steps.Add(step1) 
 
                'next we need a trigger 
                'we'll schedule this to run at 12:05 PM every day 
 
                'add a single time (12:05 PM) to the time criterion 
                timecriterion = theScheduler.CreateObject(ClassIDEnum.CID_SpecifyTimeCriterion) 
                jobTime = Date.Parse(jobLine(6)) 
                timecriterion.Add(jobTime) 
 
                'set the date criterion to execute every day 
                datecriterion = theScheduler.CreateObject(ClassIDEnum.CID_DayIntervalCriterion) 
                datecriterion.Interval = jobLine(5) 
 
 
                'setting the date specification to run on MTWRF only 
                'daycriterion = theScheduler.CreateObject(ClassIDEnum.CID_DaySpecification) 
                'dayspecs.WeekdayMask = 111110 
 
                'assign the date criterion to the date schedule 
                dateschedule1 = theScheduler.CreateObject(ClassIDEnum.CID_DateSchedule) 
                dateschedule1.DateCriterion = datecriterion 
 
                'add the date and time criteria to the schedule 
                schedule1 = theScheduler.CreateObject(ClassIDEnum.CID_Schedule) 
                schedule1.DateSchedule = dateschedule1 
                schedule1.TimeCriterion = timecriterion 
 
                'add the schedule to the trigger 
                trigger = theScheduler.CreateObject(ClassIDEnum.CID_ScheduleTrigger) 
                trigger.Schedules.Add(schedule1) 
 
                'and add the trigger to the job 
                job1.Triggers.Add(trigger) 
 
 
                'before we save the job we'll validate it 
                'Saving automatically validates first, but if Save returns validation errors, 
                'we'd have to call Validate 
                'anyway to get details of the error 
                'first cast the job to an IProvideValidation interface 
                ipv = job1 
                'errorSeverity = ipv.Validate(errors) 
                'If errorSeverity > ADErrorSeverity.adetWarning Then 
                'one or more errors were reported. 
                'examine the contents of the errors collection for details 
                'Else 
                'validation was successful. Save the job. 
                job1.Save() 
                'End If 
 
            Next 
 
 
        End Sub 
        Private Function GetRecipient(ByVal emailAddress As String, ByVal theScheduler As scheduler) As NotificationAddress 
            Dim recipients As ADTObjects 
            Dim i As Integer, n As Integer 
            Dim address As NotificationAddress 
            Dim recipient As NotificationIndividual 
 
            'GetObjectsOfClassWhere will return all NotificationIndividuals; then we look for the one we want 
            recipients = theScheduler.GetObjectsForClass(ClassIDEnum.CID_NotificationIndividual) 
 
            For i = 1 To recipients.Count 
                recipient = recipients(i) 
                For n = 1 To recipient.Addresses.Count 
                    address = recipient.Addresses(n) 
                    If String.Compare(address.RecipientAddress, emailAddress, True) = 0 Then 
                        Return recipient 
                    End If 
                Next 
 
            Next 
 
            'no existing recipient found; create a new one 
            recipient = theScheduler.CreateObject(ClassIDEnum.CID_NotificationIndividual) 
            recipient.Name = emailAddress 
 
            address = theScheduler.CreateObject(ClassIDEnum.CID_NotificationAddress) 
            address.AddressType = NotificationAddressTypeEnum.natSMTP 
            address.RecipientAddress = emailAddress 
            recipient.Addresses.Add(address) 
            Return recipient 
        End Function 
 
 
    End Module 
End Namespace 
 
Bill Staff (599 posts)
July 22, 2009 09:01 AM
Accepted Answer
Your GetRecipient method is defined with a return type of NotificationAddress. The return type should be NotificationIndividual.
emailrhoads (5 posts)
July 27, 2009 08:42 AM
Accepted Answer

I have modified what I have and it works until the return statements in the GetRecipients method.

I do not understand why the return fails.

 

New code:

Imports ADTempus 
Imports System.IO 
 
 
Namespace AdTempusAPI 
 
 
    Module Module1 
 
        Sub Main() 
 
            'Dim dayspecs As DaySpecification  
            Dim jobTime As Date 
            Dim theScheduler As scheduler 
            Dim theApp As Application 
            Dim job1 As Job 
            Dim step1 As JobStep 
            Dim progex As ProgramExecutionTask 
            Dim trigger As ScheduleTrigger 
            Dim schedule1 As Schedule 
            Dim dateschedule1 As DateSchedule 
            Dim timecriterion As SpecifyTimeCriterion 
            'Dim daycriterion As SpecifyDaysCriterion  
            Dim datecriterion As DayIntervalCriterion 
            'Dim theresponse As Response 
            Dim newresponse As Response 
            Dim eventFilter As JobEventFilter 
            Dim thenotificationaction As NotificationAction 
            Dim newrecipient As NotificationIndividual 
            'Dim restartAction As JobControlAction 
 
 
 
 
 
            'Dim errors As ArcanaDevelopment.ADErrorHandling.ADErrors  
            'Dim errorSeverity As ADErrorSeverity  
 
            ' Loop through each line in array returned by ReadAllLines  
            Dim line As String 
            For Each line In File.ReadAllLines("C:\inputs.csv") 
 
                ' Split line on comma  
                Dim jobLine As String() = line.Split(New Char() {","c}) 
 
 
                Dim ipv As IProvideValidation 
                'create an application object  
                theApp = New Application 
 
                'create a new session using native Windows security  
                theScheduler = theApp.Connect("", "") 
 
                'Data objects (objects derived from IADTObject) cannot be directly created.  
                'They must be created through a call to scheduler.CreateObject()  
                job1 = theScheduler.CreateObject(ClassIDEnum.CID_Job) 
 
                job1.Name = jobLine(0) 
 
                'replace with the appropriate credentials  
                job1.UserID = jobLine(1) 
                job1.Password = jobLine(2) 
 
                'we'll use the defaults for all other Job properties  
 
 
                'next we need a step  
                step1 = theScheduler.CreateObject(ClassIDEnum.CID_JobStep) 
 
                'and a task. Use a ProgramExecutionTask to run a program  
                progex = theScheduler.CreateObject(ClassIDEnum.CID_ProgramExecutionTask) 
 
                'we'll run Notepad.exe (%windir% will be expanded by adTempus  
                'to the value of the WINDIR environment variable)  
                progex.ExecutionTarget = jobLine(3) 
                progex.CommandLineParameters = jobLine(4) 
                progex.WindowMode = WindowModeEnum.wmNormal 'we want it to be visible  
 
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
                '***************************************************************************************************************  
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
                'we want to look at the exit code to determine success  
                progex.SuccessCriterion = SuccessCriterionEnum.scExitCode 
                'success is indicated by an exit code <= 4  
                progex.ExitCodeCriterion = ExitCodeTestTypeEnum.exitCodeLE 
                progex.SuccessMinCode = 4 
 
                'if the task fails, we want to retry it.  
                'create the response  
                'theresponse = theScheduler.CreateObject(ClassIDEnum.CID_Response) 
 
                'create an event filter to trigger the response when the step fails()  
                'eventFilter = theScheduler.CreateObject(ClassIDEnum.CID_JobEventFilter) 
                'eventFilter.Event = JobEventEnum.jeStepFailed 
                'theresponse.Events.Add(eventFilter) 
 
                'now the action to restart  
                'restartAction = theScheduler.CreateObject(ClassIDEnum.CID_JobControlAction) 
                'restartAction.ControlType = JobControlActionsEnum.jcaRestartStep 
                'restartAction.RestartDelay = 120 'wait 120 seconds (=2 minutes) before trying again()  
                'restartAction.RetryLimit = 4 'retry up to 4 times  
 
                'theresponse.Actions.Add(thenotificationaction) 
                'step1.Responses.Add(theresponse) 
 
                'we want to send e-mail notification if the task still doesn't succeed after the 4 retries.  
                'first create the recipient. This method will retrieve the existing  
                'recipient object if one exists, or create a new one if necessary  
 
                newrecipient = GetRecipient("[email protected]", theScheduler) 
 
                'create another response  
                newresponse = theScheduler.CreateObject(ClassIDEnum.CID_Response) 
 
                'create an event filter to trigger the response when the restart limit Is exceeded  
                eventFilter = theScheduler.CreateObject(ClassIDEnum.CID_JobEventFilter) 
                eventFilter.Event = JobEventEnum.jeStepFailed 
                newresponse.Events.Add(eventFilter) 
 
                'create the action to send the notification  
                thenotificationaction = theScheduler.CreateObject(ClassIDEnum.CID_NotificationAction) 
                thenotificationaction.Recipients.Add(newrecipient) 
                'we'll use the default subject and message, so we don't need to do anything else with the action  
 
                newresponse.Actions.Add(thenotificationaction) 
                step1.Responses.Add(newresponse) 
 
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
                '***************************************************************************************************************  
                '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
 
                'assign the task to the step  
                step1.Task = progex 
 
                'add the step to the job  
                job1.Steps.Add(step1) 
 
                'next we need a trigger  
                'we'll schedule this to run at 12:05 PM every day  
 
                'add a single time (12:05 PM) to the time criterion  
                timecriterion = theScheduler.CreateObject(ClassIDEnum.CID_SpecifyTimeCriterion) 
                jobTime = Date.Parse(jobLine(6)) 
                timecriterion.Add(jobTime) 
 
                'set the date criterion to execute every day  
                datecriterion = theScheduler.CreateObject(ClassIDEnum.CID_DayIntervalCriterion) 
                datecriterion.Interval = jobLine(5) 
 
 
                'setting the date specification to run on MTWRF only  
                'daycriterion = theScheduler.CreateObject(ClassIDEnum.CID_DaySpecification)  
                'dayspecs.WeekdayMask = 111110  
 
                'assign the date criterion to the date schedule  
                dateschedule1 = theScheduler.CreateObject(ClassIDEnum.CID_DateSchedule) 
                dateschedule1.DateCriterion = datecriterion 
 
                'add the date and time criteria to the schedule  
                schedule1 = theScheduler.CreateObject(ClassIDEnum.CID_Schedule) 
                schedule1.DateSchedule = dateschedule1 
                schedule1.TimeCriterion = timecriterion 
 
                'add the schedule to the trigger  
                trigger = theScheduler.CreateObject(ClassIDEnum.CID_ScheduleTrigger) 
                trigger.Schedules.Add(schedule1) 
 
                'and add the trigger to the job  
                job1.Triggers.Add(trigger) 
 
 
                'before we save the job we'll validate it  
                'Saving automatically validates first, but if Save returns validation errors,  
                'we'd have to call Validate  
                'anyway to get details of the error  
                'first cast the job to an IProvideValidation interface  
                ipv = job1 
                'errorSeverity = ipv.Validate(errors)  
                'If errorSeverity > ADErrorSeverity.adetWarning Then  
                'one or more errors were reported.  
                'examine the contents of the errors collection for details  
                'Else  
                'validation was successful. Save the job.  
                job1.Save() 
                'End If  
 
            Next 
 
 
        End Sub 
        Private Function GetRecipient(ByVal emailAddress As String, ByVal theScheduler As scheduler) As NotificationAddress 
            Dim recipients As ADTObjects 
            Dim i As Integer, n As Integer 
            Dim address As NotificationAddress 
            Dim recipient As NotificationIndividual 
 
            'GetObjectsOfClassWhere will return all NotificationIndividuals, then we look for the one we want  
            recipients = theScheduler.GetObjectsForClass(ClassIDEnum.CID_NotificationIndividual) 
 
            For i = 1 To recipients.Count 
                recipient = recipients(i) 
                For n = 1 To recipient.Addresses.Count 
                    address = recipient.Addresses(n) 
                    If String.Compare(address.RecipientAddress, emailAddress, True) = 0 Then 
                        Return recipient 
                    End If 
                Next 
 
            Next 
 
            'no existing recipient found; create a new one  
            recipient = theScheduler.CreateObject(ClassIDEnum.CID_NotificationIndividual) 
            recipient.Name = emailAddress 
 
            address = theScheduler.CreateObject(ClassIDEnum.CID_NotificationAddress) 
            address.AddressType = NotificationAddressTypeEnum.natSMTP 
            address.RecipientAddress = emailAddress 
            recipient.Addresses.Add(address) 
            Return recipient 
        End Function 
 
 
    End Module 
End Namespace 

Bill Staff (599 posts)
July 27, 2009 08:49 AM
Accepted Answer
It doesn't look like you've changed anything. The code you posted still has GetRecipient returning type NotificationAddress. It should be returning type NotificationIndividual.
emailrhoads (5 posts)
July 27, 2009 12:43 PM
Accepted Answer
the job creation completes successfully with the change, but no responses appear in the console. It is almost as though they are not saved.  Any suggestions?
Bill Staff (599 posts)
July 28, 2009 09:34 AM
Accepted Answer

I tried your code and it worked fine. Note that you are adding the response to the step, not the job, so make sure you are looking at the step's responses rather than the job's when you look in the Console.

On a separate note, I noticed that your code is creating a new application object and session on each iteration for your job creation loop. It would be more efficient to move those outside the loop and use the same session for each job that you create.


Replies are disabled for this topic.