public void BeforeStepRun(Step step) { IDictionary<String, String> replacements = new Dictionary<String, String>(); foreach(String key in step.Task.Parameters.Keys) { String currentValue = step.Task.Parameters[key]; if (currentValue != null) { foreach (Match match in Regex.Matches(currentValue, VARIABLE_PLACEHOLDER)) { // Get variable name. String variableName = match.Groups["varName"].Value; //TODO: We should have a way to specify a default value. Object defaultValue = "defaultii"; // Grab input from the environment. object input = this.RequestInput("Enter value for variable '" + variableName + "'", defaultValue); // Do the usual checks, then replace placeholder with the actual value. String givenValue = input != null ? input.ToString() : ""; currentValue = currentValue.Replace("${INPUT{" + variableName + "}}", givenValue); } replacements.Add(key, currentValue); } } foreach(String key in replacements.Keys) step.Task.Parameters[key] = replacements[key]; scriptRunner.BeforeStepRun(step); }
public void AfterStepRun(Step step, bool withError) { scriptRunner.AfterStepRun(step, withError); if (withError) log(String.Format("Step '{0}' finished, but an error ocurred.", step.Name)); else log(String.Format("Step '{0}' finished.", step.Name)); }
public void BeforeStepRun(Step step) { IDictionary<String, String> replacements = new Dictionary<String, String>(); foreach(String key in step.Task.Parameters.Keys) { String currentValue = step.Task.Parameters[key]; if (currentValue != null) { foreach (Match match in Regex.Matches(currentValue, VARIABLE_PLACEHOLDER)) { String variableName = match.Groups["varName"].Value; currentValue = currentValue.Replace("${{" + variableName + "}}", Context.GetVariable<Object>(variableName) != null ? Context.GetVariable<Object>(variableName).ToString() : ""); } replacements.Add(key, currentValue); } } foreach(String key in replacements.Keys) step.Task.Parameters[key] = replacements[key]; scriptRunner.BeforeStepRun(step); }
public void StepError(Step step, Exception exception) { scriptRunner.StepError(step, exception); }
public void BeforeStepRun(Step step) { scriptRunner.BeforeStepRun(step); }
public void AfterStepRun(Step step, bool withError) { scriptRunner.AfterStepRun(step, withError); }
public virtual void BeforeStepRun(Step step) { }
void script_StepSkipped(Step step) { addLogItem("Skipped execution of step '" + step.Name + "'.", Color.Red); }
void script_StepError(Step step, Exception exception) { addLogItem("Error executing step '" + step.Name + "': " + exception.Message, Color.Red); }
public bool StepRun(Step step) { bool stepExecuted = scriptRunner.StepRun(step); if (stepExecuted) log(String.Format("Script runner decided to execute step '{0}'.", step.Name)); else log(String.Format("Script runner decided NOT to execute step '{0}'.", step.Name)); return stepExecuted; }
public void StepError(Step step, Exception exception) { scriptRunner.StepError(step, exception); log(String.Format("Error executing step '{0}': {1}", step.Name, exception)); }
public void RemoveStep(Step step) { steps.Remove(step); }
public abstract bool StepRun(Step step);
public virtual void StepError(Step step, Exception exception) { }
public bool StepRun(Step step) { if (AskConfirmation(step.Name)) return scriptRunner.StepRun(step); else return false; }
public override bool StepRun(Step step) { step.Execute(Context); return true; }
public void BeforeStepRun(Step step) { scriptRunner.BeforeStepRun(step); log(String.Format("About to execute step '{0}'.", step.Name)); }
void script_StepFinished(Step step) { addLogItem("Finished execution of step '" + step.Name + "'."); }
public bool StepRun(Step step) { return scriptRunner.StepRun(step); }
void script_StepStarting(Step step) { addLogItem("Executing step '" + step.Name + "' [" + step.Task.Name + "] ..."); }
public virtual void AfterStepRun(Step step, bool withError) { }