private static void EnterPromptValue(IDssWorkflowApp workflowApp, WorkflowPromptValue item) { Retry.WhileThrowing <DeviceWorkflowException>( () => workflowApp.EnterPromptValue(item.PromptText, item.PromptValue), 3, TimeSpan.FromSeconds(5)); // increased the waiting from two seconds to five }
/// <summary> /// Sets up the scan job. /// </summary> /// <param name="device">The device.</param> protected override void SetupJob(IDevice device) { ScanLog.JobEndStatus = "Failed"; if (device == null) { throw new ArgumentNullException("device"); } // Update the destination type ScanLog.ScanType = _data.DestinationType; ScanLog.Ocr = _data.UseOcr; UpdateStatus(string.Format("Setting up device at address {0} for user {1}", device.Address, ExecutionData.Credential.UserName)); InitializeAuthenticator(_data.AuthProvider, device, ExecutionData); // Load the workflow application _workflowApp = DssWorkflowAppFactory.Create(device); _workflowApp.WorkflowLogger = Authenticator.WorkflowLogger = WorkflowLogger; _workflowApp.Pacekeeper = Authenticator.Pacekeeper = new Pacekeeper(_data.AutomationPause); _workflowApp.Launch(Authenticator, !_data.ApplicationAuthentication ? AuthenticationMode.Eager : AuthenticationMode.Lazy); // Select the workflow and enter the parameters _workflowApp.SelectWorkflow(_data.WorkflowName); foreach (WorkflowPromptValue item in _data.PromptValues) { EnterPromptValue(_workflowApp, item); } if (!_data.ExcludeFileNamePrompt) { // Set the file name (required for validation) WorkflowPromptValue fileNamePrompt = new WorkflowPromptValue(FileNamePrompt, FilePrefix.ToString().ToLowerInvariant()); EnterPromptValue(_workflowApp, fileNamePrompt); } // Set job build _workflowApp.Options.SetJobBuildState(this.UseJobBuild); }