Example #1
0
        /// <summary>
        /// 解析CreateWF参数
        /// </summary>
        /// <param name="strPars"></param>
        public override void ParseRunParam(string strPars)
        {
            if (strPars == "null")
            {
                return;
            }

            ((List <TimerCreateWFPa>)m_run_params).Clear();

            //解析多个创建工作流实体的参数
            JArray j_pars = JArray.Parse(strPars);

            //对JSon数组元素进行遍历
            for (int i = 0; i < j_pars.Count(); i++)
            {
                var par = j_pars[i];

                if (par is JObject)
                {
                    Dictionary <string, string> dict_params = null;
                    Dictionary <string, string> dict_record = null;
                    Dictionary <string, Dictionary <string, string> > dict_timer = null;
                    var enumerator = ((JObject)par).GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        var Jval = enumerator.Current;

                        //解析传递给工作流实体参数的信息
                        if (Jval.Key == "PARAMS")
                        {
                            dict_params = ParseJObjectToDictionary((JObject)Jval.Value);
                        }
                        //解析传递给工作流实体的Record信息
                        if (Jval.Key == "RECORD")
                        {
                            dict_record = ParseJObjectToDictionary((JObject)Jval.Value);
                        }
                        //解析Timer
                        if (Jval.Key == "TIMER")
                        {
                            dict_timer = ParseJObjectToDictionary((JObject)Jval.Value, true);
                        }

                        //如果两者解析都合法
                        if (dict_params != null && dict_record != null && dict_timer != null)
                        {
                            TimerCreateWFPa creatPas = new TimerCreateWFPa();
                            creatPas.wf_params = dict_params;
                            creatPas.wf_record = dict_record;
                            creatPas.wf_timer  = dict_timer;

                            ((List <TimerCreateWFPa>)m_run_params).Add(creatPas);
                        }
                    }
                }
            }
        }
Example #2
0
 /// <summary>
 /// 添加新建工作流实体变量
 /// </summary>
 /// <param name="newCreate"></param>
 public void AppendCreateParam(TimerCreateWFPa newCreate)
 {
     ((List <TimerCreateWFPa>)m_run_params).Add(newCreate);
 }