Пример #1
0
        public virtual JObject GetProcessForecastSteps(HttpContext context)
        {
            YZRequest request     = new YZRequest(context);
            string    processName = request.GetString("processName");
            Version   version     = request.GetVersion("version");
            string    owner       = request.GetString("owner", null);
            string    xmlData     = request.GetString("xmlData", null);

            if (!String.IsNullOrEmpty(xmlData))
            {
                xmlData = Encoding.UTF8.GetString(Convert.FromBase64String(xmlData));
            }

            if (String.IsNullOrEmpty(owner))
            {
                throw new Exception(String.Format(Resources.YZStrings.Aspx_ProcessForecastNoPos, YZAuthHelper.LoginUserAccount));
            }

            JObject rv = new JObject();

            //获得数据
            BPMStepCollection steps = null;

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                steps = BPMProcess.GetForecastSteps(cn, processName, version, owner, xmlData);

                //将数据转化为Json集合
                JArray children = new JArray();
                rv[YZJsonProperty.children] = children;

                foreach (BPMProcStep step in steps)
                {
                    if (!step.IsHumanStep)
                    {
                        continue;
                    }

                    children.Add(Serialize(cn, step));
                }

                rv[YZJsonProperty.total] = children.Count;
            }

            //输出数据
            rv[YZJsonProperty.success] = true;
            return(rv);
        }