Example #1
0
 /// <summary>
 /// Set defaults for a new empty job
 /// </summary>
 private void SetDefaults()
 {
     this.alreadyCreated = false;
     this.currentName    = originalName = string.Empty;
     this.command        = string.Empty;
     this.commandExecutionSuccessCode = 0;
     this.databaseName     = "master";
     this.databaseUserName = string.Empty;
     this.server           = string.Empty;
     this.originalId       = this.id = -1;
     this.failureAction    = StepCompletionAction.QuitWithFailure;
     this.failStep         = null;
     this.failStepId       = -1;
     this.successAction    = StepCompletionAction.GoToNextStep;
     this.successStep      = null;
     this.successStepId    = -1;
     this.priority         = OSRunPriority.Normal;
     this.outputFileName   = string.Empty;
     this.appendToLogFile  = false;
     this.appendToStepHist = false;
     this.writeLogToTable  = false;
     this.appendLogToTable = false;
     this.retryAttempts    = 0;
     this.retryInterval    = 0;
     this.subSystem        = AgentSubSystem.TransactSql;
     this.proxyName        = string.Empty;
     this.urn = null;
 }
Example #2
0
 // copy constructor
 public JobStepData(JobStepData source)
 {
     this.originalName   = source.originalName;
     this.currentName    = source.currentName;
     this.alreadyCreated = source.alreadyCreated;
     this.deleted        = source.deleted;
     this.command        = source.command;
     this.commandExecutionSuccessCode = source.commandExecutionSuccessCode;
     this.databaseName     = source.databaseName;
     this.databaseUserName = source.databaseUserName;
     this.server           = source.server;
     this.id               = source.id;
     this.originalId       = source.originalId;
     this.failureAction    = source.failureAction;
     this.failStep         = source.failStep;
     this.failStepId       = source.failStepId;
     this.successAction    = source.successAction;
     this.successStep      = source.successStep;
     this.successStepId    = source.successStepId;
     this.priority         = source.priority;
     this.outputFileName   = source.outputFileName;
     this.appendToLogFile  = source.appendToLogFile;
     this.appendToStepHist = source.appendToStepHist;
     this.writeLogToTable  = source.writeLogToTable;
     this.appendLogToTable = source.appendLogToTable;
     this.retryAttempts    = source.retryAttempts;
     this.retryInterval    = source.retryInterval;
     this.subSystem        = source.subSystem;
     this.proxyName        = source.proxyName;
     this.urn              = source.urn;
     this.parent           = source.parent;
 }
Example #3
0
        /// <summary>
        /// load data from and existing step
        /// </summary>
        /// <param name="source"></param>
        private void LoadData(JobStep source)
        {
            this.alreadyCreated = true;
            currentName         = originalName = source.Name;
            this.urn            = source.Urn;
            this.successAction  = source.OnSuccessAction;
            this.failureAction  = source.OnFailAction;
            this.originalId     = this.id = source.ID;
            this.subSystem      = source.SubSystem;
            this.failStepId     = source.OnFailStep;
            this.successStepId  = source.OnSuccessStep;

            this.cachedSource = source;
        }
Example #4
0
        public void StepFailureAction(StepCompletionAction action, JobStepData step)
        {
            // parameter check. must supply step if the action is GoToStep
            if (action == StepCompletionAction.GoToStep && step == null)
            {
                throw new InvalidOperationException();
            }
            // don't supply step if it's an action other than GotoStep
            if (action != StepCompletionAction.GoToStep && step != null)
            {
                throw new InvalidOperationException();
            }
            else if (step == this)
            {
                throw new InvalidArgumentException("step");
            }

            this.failureAction = action;
            this.failStep      = step;
        }