public void AddTransaction(string tType, IStepModel step, IStepService stepService, String stepName = "", String parentTransactionName = "")
        {
            try
            {
                var fc = new FunctionCall();
                var fcs = new FunctionCallSignature { Name = tType};

                //check if the step is already predefined. This is in case of surrounding web_concurrent_start and web_concurrent_end
                //String name = (stepName == "") ? tNumber + ". " + step.ComposedName : tNumber + ". " + stepName;

                fcs.Parameters.Add(new FunctionCallParameter(stepName, ParameterType.ArgtypeString));
                //if we are adding lr_start_sub_transaction add the parent transaction name
                if (tType.Contains("start_sub"))
                    fcs.Parameters.Add(new FunctionCallParameter(parentTransactionName, ParameterType.ArgtypeNumber));

                //if we are adding lr_end_transaction add the LR_AUTO parameter
                if (tType.Contains("end"))
                    fcs.Parameters.Add(new FunctionCallParameter("LR_AUTO", ParameterType.ArgtypeNumber));

                fc.Signature = fcs;
                fc.Location = new FunctionCallLocation(step.FunctionCall.Location.FilePath, null, null);
                IStepModel newStep = stepService.GenerateStep(fc);

                RelativeStep relativity = (tType.Contains("start")) ? RelativeStep.Before : RelativeStep.After;

                if (tType.Contains("end"))
                    tNumber++;

                stepService.AddStep(ref newStep, step, relativity, false);
            }
            catch (Exception ex)
            {
                MessageService.ShowMessage(string.Format(ex.StackTrace));
            }
        }
Example #2
0
        public IActionResult Add(Step step)
        {
            if (ModelState.IsValid)
            {
                StepViewModel modelStep = _stepService.getLastStep(step.WorkFlowId);
                if (modelStep.step != null)
                {
                    modelStep.step.IsFinalStep = false;
                }
                StepViewModel modelGetMax           = _stepService.getMax(step.WorkFlowId);
                int           LastNumberOfStepOrder = modelGetMax.StepOrder;
                step.StepOrder = LastNumberOfStepOrder + 1;
                _stepService.AddStep(step);

                StepViewModel model = _stepService.getLastFiveElement();
                return(PartialView("/Views/Home/_ListStep.cshtml", model));
            }
            return(RedirectToAction("Index", "Default"));
        }
        public IHttpActionResult Post(
            StepViewModel step)
        {
            IHttpActionResult ret = null;

            if (ModelState.IsValid)
            {
                var savedStep = _stepService.AddStep(step);
                ret = Created <StepViewModel>(
                    Request.RequestUri +
                    savedStep.Id.ToString(),
                    step);
            }
            else
            {
                System.Web.Http.ModelBinding.ModelStateDictionary errors =
                    BgsHelper.ConvertToModelState(ModelState);

                ret = BadRequest(errors);
            }

            return(ret);
        }
 public void Post([FromBody] Step step)
 {
     _iss.AddStep(step);
 }
Example #5
0
 public StepView AddOneStep([FromBody] Step step)
 {
     return(stepService.AddStep(step));
 }