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);
        }
Example #2
0
        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);
 }
Example #7
0
 public virtual void BeforeStepRun(Step step)
 {
 }
Example #8
0
 void script_StepSkipped(Step step)
 {
     addLogItem("Skipped execution of step '" + step.Name + "'.", Color.Red);
 }
Example #9
0
 void script_StepError(Step step, Exception exception)
 {
     addLogItem("Error executing step '" + step.Name + "': " + exception.Message, Color.Red);
 }
Example #10
0
        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;
        }
Example #11
0
        public void StepError(Step step, Exception exception)
        {
            scriptRunner.StepError(step, exception);

            log(String.Format("Error executing step '{0}': {1}", step.Name, exception));
        }
Example #12
0
 public void RemoveStep(Step step)
 {
     steps.Remove(step);
 }
Example #13
0
 public abstract bool StepRun(Step step);
Example #14
0
 public virtual void StepError(Step step, Exception exception)
 {
 }
 public bool StepRun(Step step)
 {
     if (AskConfirmation(step.Name))
         return scriptRunner.StepRun(step);
     else
         return false;
 }
Example #16
0
        public override bool StepRun(Step step)
        {
            step.Execute(Context);

            return true;
        }
Example #17
0
        public void BeforeStepRun(Step step)
        {
            scriptRunner.BeforeStepRun(step);

            log(String.Format("About to execute step '{0}'.", step.Name));
        }
Example #18
0
 void script_StepFinished(Step step)
 {
     addLogItem("Finished execution of step '" + step.Name + "'.");
 }
 public bool StepRun(Step step)
 {
     return scriptRunner.StepRun(step);
 }
Example #20
0
 void script_StepStarting(Step step)
 {
     addLogItem("Executing step '" + step.Name + "' [" + step.Task.Name + "] ...");
 }
Example #21
0
 public virtual void AfterStepRun(Step step, bool withError)
 {
 }