Exemplo n.º 1
0
        /// <summary>
        /// 更新信息
        /// </summary>
        /// <param name="">信息</param>
        /// <returns>更新行数</returns>
        public DataResult <int> Update(ProcessFlow model)
        {
            DataResult <int> result = new DataResult <int>();

            try
            {
                if (ExistsCode(model))
                {
                    result.Msg    = "编号已存在";
                    result.Result = -1;
                    return(result);
                }
                if (ExistsName(model))
                {
                    result.Msg    = "名称已存在";
                    result.Result = -1;
                    return(result);
                }
                model.UPDATEUSER = this.LoginUser.UserID;
                result.Result    = new ProcessFlowDAL().Update(model);
                result.IsSuccess = true;
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            ProcessFlow    info = new ProcessFlow();
            ProcessFlowBLL bll  = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);

                bll = BLLFactory.CreateBLL <ProcessFlowBLL>();

                if (this.hiID.Value == "")
                {
                    bll.Insert(info);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.PID        = this.hiID.Value;
                    bll.Update(info);
                }

                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public override Packet Read(BinaryReader reader)
        {
            var processFlow = new ProcessFlow();

            var type = reader.ReadInt32();

            if (!IsValidProcessFlow(type))
            {
                ThrowException();
            }

            var titleSize    = reader.ReadInt32();
            var hostNameSize = reader.ReadInt32();

            if (titleSize < 0 || hostNameSize < 0)
            {
                ThrowException();
            }

            processFlow.ProcessFlowType = (ProcessFlowType)type;
            processFlow.ProcessId       = reader.ReadInt32();
            processFlow.ThreadId        = reader.ReadInt32();
            processFlow.Timestamp       = ReadTimestamp(reader);
            processFlow.Title           = ReadString(reader, titleSize);
            processFlow.HostName        = ReadString(reader, hostNameSize);

            Logging.SDK.LogObject(Level.Debug, "processFlow",
                                  processFlow);
            return(processFlow);
        }
Exemplo n.º 4
0
        private void BindData()
        {
            string         id   = Request.QueryString["id"];
            ProcessFlowBLL bll  = null;
            ProcessFlow    info = new ProcessFlow();

            try
            {
                bll = BLLFactory.CreateBLL <ProcessFlowBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.PID = id;
                    info     = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.PID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                }
                else
                {
                    info = new ProcessFlow();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 插入信息(单表)
        /// </summary>
        /// <param name="">信息</param>
        /// <returns>插入行数</returns>
        public DataResult <int> Insert(ProcessFlow model)
        {
            DataResult <int> result = new DataResult <int>();

            try
            {
                //基本信息
                model.PID        = Guid.NewGuid().ToString();
                model.CREATEUSER = this.LoginUser.UserID;
                model.CREATETIME = DateTime.Now;
                model.UPDATEUSER = model.CREATEUSER;
                model.UPDATETIME = model.CREATETIME;
                ProcessFlowDAL cmdDAL = new ProcessFlowDAL();
                if (ExistsCode(model))
                {
                    result.Msg    = "编号已存在";
                    result.Result = -1;
                    return(result);
                }
                if (ExistsName(model))
                {
                    result.Msg    = "名称已存在";
                    result.Result = -1;
                    return(result);
                }
                result.Result    = new ProcessFlowDAL().Insert(model);
                result.IsSuccess = true;
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="condition">条件</param>
        /// <param name="page">数据页</param>
        /// <returns>数据页</returns>
        public DataPage GetList(ProcessFlow condition, DataPage page)
        {
            string sql = null;
            List <DataParameter> parameters = new List <DataParameter>();

            try
            {
                sql = this.GetQuerySql(condition, ref parameters);
                //分页关键字段及排序
                page.KeyName = "PID";
                if (string.IsNullOrEmpty(page.SortExpression))
                {
                    page.SortExpression = "UPDATETIME DESC";
                }
                using (IDataSession session = AppDataFactory.CreateMainSession())
                {
                    page = session.GetDataPage <ProcessFlow>(sql, parameters.ToArray(), page);
                }
                return(page);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DebugTrace GetDebugTrace(string processName, string processFlowSymbols, FlatteningPrefixType prefixType)
        {
            ProcessFlow flow = ProcessFlow.DeserializeProcessFlow(processFlowSymbols);

            flow.ProcessName = processName;

            return(flow.Flatten(prefixType));
        }
Exemplo n.º 8
0
        public DebugTrace GenerateDebugTrace(ProcessFlow flow)
        {
            DebugTrace trace = new DebugTrace();

            trace.ProcessName = flow.ProcessName;
            this.decompileFlow(flow, ref trace);

            return(trace);
        }
Exemplo n.º 9
0
 /// <summary>
 /// 删除信息
 /// </summary>
 /// <param name="">信息</param>
 /// <returns>删除个数</returns>
 public int DeleteProcessFlow(ProcessFlow model)
 {
     try
     {
         return(new ProcessFlowDAL().Delete(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// 判断名称是否存在
 /// </summary>
 /// <param name="">信息</param>
 /// <returns>true:已存在;fasel:不存在。</returns>
 public bool ExistsName(ProcessFlow model)
 {
     try
     {
         return(new ProcessFlowDAL().ExistsName(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <param name="condition">条件</param>
 /// <param name="page">数据页</param>
 /// <returns>数据页</returns>
 public DataPage GetList(ProcessFlow condition, DataPage page)
 {
     try
     {
         return(new ProcessFlowDAL().GetList(condition, page));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// 获取信息
 /// </summary>
 /// <param name="">条件</param>
 /// <returns>信息</returns>
 public ProcessFlow Get(ProcessFlow model)
 {
     try
     {
         return(new ProcessFlowDAL().Get(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// 获取信息
 /// </summary>
 /// <param name="">条件</param>
 /// <returns>*信息</returns>
 public ProcessFlow Get(ProcessFlow model)
 {
     try
     {
         using (IDataSession session = AppDataFactory.CreateMainSession())
         {
             //获取信息
             model = session.Get <ProcessFlow>(model);
         }
         return(model);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 14
0
        /// <summary>
        /// 删除信息
        /// </summary>
        /// <param name=""></param>
        /// <returns>删除个数</returns>
        public int Delete(ProcessFlow model)
        {
            int count = 0;

            try
            {
                using (IDataSession session = AppDataFactory.CreateMainSession())
                {
                    //删除基本信息
                    count = session.Delete <ProcessFlow>(model);
                }
                return(count);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 15
0
        private void BindData()
        {
            ProcessFlowBLL bll       = null;
            DataPage       dp        = new DataPage();
            ProcessFlow    condition = new ProcessFlow();
            string         eID       = Request.QueryString["eID"];

            if (!string.IsNullOrEmpty(eID))
            {
                if (eID.Split('|')[1] == "F")
                {
                    condition.FACTORYPID = eID.Split('|')[0];
                }
                else
                {
                    condition.PRODUCTLINEPID = eID.Split('|')[0];
                }
            }
            try
            {
                bll             = BLLFactory.CreateBLL <ProcessFlowBLL>();
                condition.PCODE = this.PCODE.Text;
                condition.PNAME = this.PNAME.Text;

                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                List <ProcessFlow> list = dp.Result as List <ProcessFlow>;
                this.GvList.DataSource = list;
                this.GvList.DataBind();

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["PID"].ToString());

                    (this.GvList.Rows[i].Cells[4].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 获取查询语句
        /// </summary>
        /// <param name="user">查询条件</param>
        /// <param name="parameters">参数</param>
        /// <returns>查询语句</returns>
        private string GetQuerySql(ProcessFlow condition, ref List <DataParameter> parameters)
        {
            StringBuilder sqlBuilder   = new StringBuilder();
            StringBuilder whereBuilder = new StringBuilder();

            try
            {
                //构成查询语句
                sqlBuilder.Append(@"SELECT * FROM T_FP_PROCESSFLOW t1");

                if (!string.IsNullOrEmpty(condition.PCODE))
                {
                    whereBuilder.Append(" AND t1.PCODE like @PCODE");
                    parameters.Add(new DataParameter("PCODE", "%" + condition.PCODE + "%"));
                }

                if (!string.IsNullOrEmpty(condition.PNAME))
                {
                    whereBuilder.Append(" AND t1.PNAME like @PNAME");
                    parameters.Add(new DataParameter("PNAME", "%" + condition.PNAME + "%"));
                }
                if (!string.IsNullOrEmpty(condition.FACTORYPID))
                {
                    whereBuilder.Append(" AND t1.FACTORYPID = @FACTORYPID");
                    parameters.Add(new DataParameter("FACTORYPID", condition.FACTORYPID));
                }
                if (!string.IsNullOrEmpty(condition.PRODUCTLINEPID))
                {
                    whereBuilder.Append(" AND t1.PRODUCTLINEPID = @PRODUCTLINEPID");
                    parameters.Add(new DataParameter("PRODUCTLINEPID", condition.PRODUCTLINEPID));
                }
                //查询条件
                if (whereBuilder.Length > 0)
                {
                    sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
                }
                return(sqlBuilder.ToString());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 17
0
 public static void Main(String[] args)
 {
     try
     {                                                                            // do not remove this try-catch statement, do not add any code outside try-block
         List <IFlowOperation> inputs = ProcessFlowFactory.LoadInput("flow.xml"); // reinstate this line before submission
         //List<IFlowOperation> inputs = ProcessFlowFactory.LoadInput(args[0]);       // remove this line before submission
         ProcessFlow flow = null;
         foreach (IFlowOperation input in inputs)
         {
             if (input is ProcessFlow)
             {
                 flow = (ProcessFlow)input;
                 flow.Init();
             }
             else if (flow != null &&
                      input is Operation)
             {
                 Operation op     = (Operation)input;
                 Object    result = null;
                 try
                 {
                     result = op.Do(flow);
                 }
                 catch (Exception e)
                 {
                 }
                 if (result != null)
                 {
                     ProcessFlowFactory.Output(op.Output(result));
                 }
             }
         }
     }
     catch (Exception e)
     {
         // do not modify the code in this catch block except to comment two lines at end of block
         Console.WriteLine("Unhandled exception: " + e.Message);
         // comment following two lines before final build and submission
         //Console.WriteLine("Press any key to exit program.");
         //Console.ReadKey();
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// 获取导出的数据
        /// </summary>
        /// <param name="user">查询条件</param>
        /// <returns>数据</returns>
        public DataTable GetExportData(ProcessFlow model)
        {
            DataTable            dt         = null;
            string               sql        = null;
            List <DataParameter> parameters = new List <DataParameter>();

            try
            {
                //构成查询语句
                sql = this.GetQuerySql(model, ref parameters);
                using (IDataSession session = AppDataFactory.CreateMainSession())
                {
                    dt           = session.GetTable(sql, parameters.ToArray());
                    dt.TableName = "ProcessFlow";
                }
                return(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 判断名称是否存在
        /// </summary>
        /// <param name="info"></param>
        /// <returns>true:已存在;fasel:不存在。</returns>
        public bool ExistsName(ProcessFlow model)
        {
            StringBuilder        sqlBuilder   = new StringBuilder();
            StringBuilder        whereBuilder = new StringBuilder();
            List <DataParameter> parameters   = new List <DataParameter>();
            int count = 0;

            try
            {
                sqlBuilder.Append("SELECT COUNT(0) FROM T_FP_PROCESSFLOW");
                whereBuilder.Append(" AND PID <> @PID ");
                parameters.Add(new DataParameter {
                    ParameterName = "PID", DataType = DbType.String, Value = model.PID
                });
                if (!string.IsNullOrEmpty(model.PCODE))
                {
                    whereBuilder.Append(" AND PNAME = @PNAME ");
                    parameters.Add(new DataParameter {
                        ParameterName = "PNAME", DataType = DbType.String, Value = model.PNAME
                    });
                }
                if (whereBuilder.Length > 0)
                {
                    sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
                }
                using (IDataSession session = AppDataFactory.CreateMainSession())
                {
                    count = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), parameters.ToArray()));
                }
                return(count > 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 20
0
        public static List <IFlowOperation> LoadInput(String pathname)
        {
            //HtmlTextWriter writer = new HtmlTextWriter();

            XmlDocument flowinXml = new XmlDocument();

            try
            {
                using (TextReader reader = File.OpenText(pathname))
                {
                    flowinXml.Load(reader);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            XmlNodeList           inputsXml = flowinXml.SelectNodes("input")[0].ChildNodes;
            List <IFlowOperation> result    = new List <IFlowOperation>();
            bool flow    = false;
            bool execute = false;
            bool query   = false;
            bool load    = false;

            foreach (XmlNode inputXml in inputsXml)
            {
                switch (inputXml.Name)
                {
                case "flow":
                {
                    if (flow == false)
                    {
                        flow = true;
                        bool        working     = true;
                        ProcessFlow processFlow = ProcessFlowFactory.MkProcessFlow(inputXml);

                        //CHECKS ALL THE STORES ARE CORRECT ELSE IF ANY ARE NULL THE PROGRAM BREAKS OUT OF FLOW
                        foreach (Store s in processFlow.stores.stores)
                        {
                            if (s == null)         //IF A STORE IS NULL
                            {
                                working = false;
                                break;
                            }
                            else
                            {
                                continue;
                            }
                        }

                        //CHECKS ALL THE LINKS ARE CORRECT ELSE IF ANY ARE NULL THE PROGRAM BREAKS OUT OF FLOW
                        foreach (Link l in processFlow.links.links)
                        {
                            if (l == null)         //IF A LINK IS NULL
                            {
                                working = false;
                                break;
                            }
                            else
                            {
                                int count = 0;
                                for (int i = 0; i < processFlow.links.links.Count; i++) //FOR EVERY LINK IN PROCESS FLOW LINKS
                                {
                                    if (l.id == processFlow.links.links[i].id)          //IF IT HAS A DUPLICATE ID MORE THAN ONCE
                                    {
                                        count++;
                                        if (count > 1)
                                        {
                                            working = false;
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }
                            }
                        }

                        //CHECKS ALL THE PROCESSES ARE CORRECT ELSE IF ANY ARE NULL THE PROGRAM BREAKS OUT OF FLOW
                        foreach (Process p in processFlow.processes.processes)
                        {
                            if (p == null)
                            {
                                working = false;
                                break;
                            }
                            else
                            {
                                continue;
                            }
                        }

                        //IF ANY OF THE CHECKS RETURNED NULL IT BREAKS OUT OF FLOW
                        if (working == false)
                        {
                            break;
                        }
                        else
                        {
                            result.Add(processFlow);
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }

                case "execute":
                {
                    if (execute == false)
                    {
                        execute = true;
                        try
                        {
                            result.Add(new OpExecute(Int32.Parse(inputXml.InnerText)));
                        }
                        catch (Exception e)
                        {
                            // do nothing
                        }
                        break;
                    }
                    else
                    {
                        break;
                    }
                }

                case "query":
                {
                    if (query == false)
                    {
                        query = true;
                        XmlNodeList   storesXml = inputXml.SelectNodes("stores/store");
                        List <String> stores    = new List <String>();
                        foreach (XmlNode storeXml in storesXml)
                        {
                            stores.Add(storeXml.InnerText);
                        }
                        stores = stores.OrderBy(n => n).ToList();
                        result.Add(new OpQuery(stores));
                        break;
                    }
                    else
                    {
                        break;
                    }
                }

                case "load":
                {
                    if (load == false)
                    {
                        load = true;
                        XmlNodeList          storeAmountsXml = inputXml.SelectNodes("storeAmount");
                        List <StoreIDAmount> storeAmounts    = new List <StoreIDAmount>();
                        foreach (XmlNode storeAmountXml in storeAmountsXml)
                        {
                            XmlNodeList storeXml = storeAmountXml.SelectNodes("store");
                            String      str      = storeXml[0].InnerText;
                            char        chr      = GetFirstChar(str);
                            if (chr != 's' || !Checks(str) || str.Length > 5 || str.Length < 2)
                            {
                                continue;
                            }

                            XmlNodeList amountXml = storeAmountXml.SelectNodes("amount");
                            int         num       = 0;
                            if (Int32.TryParse(amountXml[0].InnerText, out num))
                            {
                                num = Int32.Parse(amountXml[0].InnerText);
                            }
                            else
                            {
                                continue;
                            }
                            storeAmounts.Add(new StoreIDAmount(str, num));
                        }
                        result.Add(new OpLoad(storeAmounts));
                        break;
                    }
                    else
                    {
                        break;
                    }
                }

                case "#comment":
                {
                    break;
                }

                default:
                {
                    throw new Exception("Unknown Xml: " + inputXml.Name);
                }
                }
            }
            return(result);
        }
Exemplo n.º 21
0
        public DsrProcessFlowTest()
        {
            var startStep = AddStep("WHAT IS THE PROBLEM ABOUT ?", "", StepInputTypeEnum.Options);

            var comissionSubstep = AddStep("WHICH COMMISSION OR BONUS ?", "COMMISSION & BONUSES", StepInputTypeEnum.Options);

            var dailycomission = AddTextInputStep("What is the issue with commissions ?", "DAILY COMISSION", "Describe the problem");

            dailycomission.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            comissionSubstep.SubSteps.Add(dailycomission);

            var monthlycomission = AddTextInputStep("What is the issue with commissions ?", "MONTHLY COMISSION", "Describe the problem");

            monthlycomission.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            comissionSubstep.SubSteps.Add(monthlycomission);

            var alllowances = AddTextInputStep("What is the issue with allowances ?", "ALLOWANCES", "Describe the problem");

            alllowances.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            comissionSubstep.SubSteps.Add(alllowances);

            var bonuses = AddTextInputStep("What is the issue with bonuses ?", "BONUSES", "Describe the problem");

            bonuses.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            comissionSubstep.SubSteps.Add(bonuses);

            var stockSubstep = AddStep("WHAT IS THE ISSUE ?", "STOCK", StepInputTypeEnum.Options);

            var demoIssue = AddTextInputStep("What is the Issue with the Demo ?", "DEMO ISSUE", "Describe the problem");

            demoIssue.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            var discrepancyIssue = AddTextInputStep("What is the Issue with the Stock ?", "STOCK DISCREPANCY", "Describe the problem");

            discrepancyIssue.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            var otherIssue = AddTextInputStep("What is the Issue with the Stock ?", "OTHER", "Describe the problem");

            otherIssue.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            stockSubstep.SubSteps.Add(demoIssue);
            stockSubstep.SubSteps.Add(discrepancyIssue);
            stockSubstep.SubSteps.Add(otherIssue);

            var hrSubstep = AddTextInputStep("WHAT IS THE HR ISSUE ?", "HR", "Describe the problem");

            hrSubstep.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            var otherSubStep = AddTextInputStep("WHAT IS THE ISSUE ?", "OTHER", "Describe the problem");

            otherSubStep.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));

            startStep.SubSteps.Add(comissionSubstep);
            startStep.SubSteps.Add(stockSubstep);
            startStep.SubSteps.Add(hrSubstep);
            startStep.SubSteps.Add(otherSubStep);

            _dsrProcessFlow = new ProcessFlow {
                Step = startStep
            };
        }
Exemplo n.º 22
0
 private async void Window_ContentRendered(object sender, EventArgs e)
 {
     ProcessFlow processFlow = new ProcessFlow(logger);
     await processFlow.Start();
 }
Exemplo n.º 23
0
        public CustomerProcessFlowTest()
        {
            var startStep = AddStep("What is the customer'sproduct ?", "", StepInputTypeEnum.Options);

            var product3 = AddStep("Is the word \'Credit\' there ?", "Product 3", StepInputTypeEnum.Options);

            var product3YesStep = AddStep("Is the line around the battery solid or dashed ?", "Yes", StepInputTypeEnum.Options);
            var solidLine       = AddStep("Is an error code showing ?", "Solid", StepInputTypeEnum.Options);

            solidLine.SubSteps.Add(AddStep("Endpoint Reached", "1", StepInputTypeEnum.Options, true));
            solidLine.SubSteps.Add(AddStep("Endpoint Reached", "2", StepInputTypeEnum.Options, true));
            solidLine.SubSteps.Add(AddStep("Endpoint Reached", "3", StepInputTypeEnum.Options, true));
            solidLine.SubSteps.Add(AddStep("Endpoint Reached", "4", StepInputTypeEnum.Options, true));
            solidLine.SubSteps.Add(AddStep("Endpoint Reached", "5", StepInputTypeEnum.Options, true));
            solidLine.SubSteps.Add(AddStep("Endpoint Reached", "6", StepInputTypeEnum.Options, true));
            solidLine.SubSteps.Add(AddStep("Endpoint Reached", "7", StepInputTypeEnum.Options, true));
            var noErrCode = AddStep("Is there physical damage ?", "No Error Code", StepInputTypeEnum.Options);

            noErrCode.SubSteps.Add(AddStep("Endpoint Reached", "Yes", StepInputTypeEnum.Options, true));

            var creditsSubStep = AddStep("Do you have the correct credits ?", "No", StepInputTypeEnum.Options);

            var creditsYesSubStep = AddNumericInputStep("How many credits are showing ?", "Yes", "Enter the number of credits");
            var networkBarsStep   = AddNumericInputStep("How many network bars are there ?", "NEXT", "Enter the number of network bars");
            var gXStep            = AddStep("Is there a G or X ?", "NEXT", StepInputTypeEnum.Options);

            var gVisibleSubStep       = AddNumericInputStep("How many bars are on the battery ?", "G", "Enter the number of battery bars");
            var xVisibleSubStep       = AddNumericInputStep("How many bars are on the battery ?", "X", "Enter the number of battery bars");
            var nothingVisibleSubStep = AddNumericInputStep("How many bars are on the battery ?", "NOTHING", "Enter the number of battery bars");

            var battChargingYes = AddStep("What is the country code ?", "Yes", StepInputTypeEnum.Options);

            battChargingYes.SubSteps.Add(AddStep("Endpoint Reached", "KE", StepInputTypeEnum.Options, true));
            battChargingYes.SubSteps.Add(AddStep("Endpoint Reached", "UG", StepInputTypeEnum.Options, true));
            battChargingYes.SubSteps.Add(AddStep("Endpoint Reached", "TZ", StepInputTypeEnum.Options, true));
            battChargingYes.SubSteps.Add(AddStep("Endpoint Reached", "GH", StepInputTypeEnum.Options, true));
            var countryCodeOther = AddTextInputStep("What is the country code ?", "OTHER", "Enter the other country code");

            countryCodeOther.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));
            battChargingYes.SubSteps.Add(countryCodeOther);

            var battChargingNo = AddStep("What is the country code ?", "No", StepInputTypeEnum.Options);

            battChargingNo.SubSteps.Add(AddStep("Endpoint Reached", "KE", StepInputTypeEnum.Options, true));
            battChargingNo.SubSteps.Add(AddStep("Endpoint Reached", "UG", StepInputTypeEnum.Options, true));
            battChargingNo.SubSteps.Add(AddStep("Endpoint Reached", "TZ", StepInputTypeEnum.Options, true));
            battChargingNo.SubSteps.Add(AddStep("Endpoint Reached", "GH", StepInputTypeEnum.Options, true));
            var countryCodeOther2 = AddTextInputStep("What is the country code ?", "OTHER", "Enter the other country code");

            countryCodeOther2.SubSteps.Add(AddStep("Endpoint Reached", "COMPLETE", StepInputTypeEnum.Options, true));
            battChargingNo.SubSteps.Add(countryCodeOther2);

            var isBatChargingStep = AddStep("Is the battery charging ?", "NEXT", StepInputTypeEnum.Options);

            isBatChargingStep.SubSteps.Add(battChargingYes);
            isBatChargingStep.SubSteps.Add(battChargingNo);

            gVisibleSubStep.SubSteps.Add(isBatChargingStep);
            xVisibleSubStep.SubSteps.Add(isBatChargingStep);
            nothingVisibleSubStep.SubSteps.Add(isBatChargingStep);

            gXStep.SubSteps.Add(gVisibleSubStep);
            gXStep.SubSteps.Add(xVisibleSubStep);
            gXStep.SubSteps.Add(nothingVisibleSubStep);

            networkBarsStep.SubSteps.Add(gXStep);

            creditsYesSubStep.SubSteps.Add(networkBarsStep);

            var creditsNoSubStep = AddNumericInputStep("How many credits are showing ?", "No", "Enter the number of credits");

            creditsNoSubStep.SubSteps.Add(networkBarsStep);

            creditsSubStep.SubSteps.Add(creditsYesSubStep);
            creditsSubStep.SubSteps.Add(creditsNoSubStep);

            noErrCode.SubSteps.Add(creditsSubStep);

            solidLine.SubSteps.Add(noErrCode);

            product3YesStep.SubSteps.Add(solidLine);
            product3YesStep.SubSteps.Add(AddStep("Endpoint Reached", "Dashed", StepInputTypeEnum.Options, true));
            product3YesStep.SubSteps.Add(AddStep("Endpoint Reached", "None", StepInputTypeEnum.Options, true));

            var product3Nostep = AddStep("Endpoint Reached", "No", StepInputTypeEnum.Options, true);

            product3.SubSteps.Add(product3YesStep);
            product3.SubSteps.Add(product3Nostep);

            var product4 = AddStep("Is the word \'Credit\' there ?", "Product 4", StepInputTypeEnum.Options);

            product4.SubSteps.Add(product3YesStep);
            product4.SubSteps.Add(product3Nostep);

            var product5 = AddTextInputStep("WHAT IS THE ISSUE ?", "DProduct 5", "Describe the problem");

            product5.SubSteps.Add(AddStep("Endpoint Reached", "Complete", StepInputTypeEnum.Options, true));

            var product6 = AddTextInputStep("WHAT IS THE ISSUE ?", "Product 6", "Describe the problem");

            product6.SubSteps.Add(AddStep("Endpoint Reached", "Complete", StepInputTypeEnum.Options, true));

            startStep.SubSteps.Add(product3);
            startStep.SubSteps.Add(product4);
            startStep.SubSteps.Add(product5);
            startStep.SubSteps.Add(product6);

            _customerProcessFlow = new ProcessFlow {
                Step = startStep
            };
        }