Example #1
0
        public virtual void SaveProcessAsFile(HttpContext context)
        {
            YZRequest request  = new YZRequest(context);
            string    filename = request.GetString("fileName");

            JObject    jProcess = JObject.Parse(Encoding.UTF8.GetString(Convert.FromBase64String(request.GetString("process", null))));
            BPMProcess process  = jProcess.ToObject <BPMProcess>();

            this.ProcessResponseHeader(context, filename, true);
            process.Save(context.Response.OutputStream);
        }
Example #2
0
        public virtual object SaveProcessAsNewVersion(HttpContext context)
        {
            YZRequest  request = new YZRequest(context);
            string     path    = request.GetString("path");
            JObject    post    = request.GetPostData <JObject>();
            BPMProcess process = post.ToObject <BPMProcess>();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                process.Save(cn, path, null, true);
            }

            return(new
            {
                server = WebConfigurationManager.AppSettings["BPMServerName"],
                version = process.Version.ToString(2)
            });
        }
Example #3
0
        public virtual object PublishProcess(HttpContext context)
        {
            YZRequest  request     = new YZRequest(context);
            string     folder      = request.GetString("folder", "");
            string     processName = request.GetString("processName");
            JObject    post        = request.GetPostData <JObject>();
            BPMProcess process     = post.ToObject <BPMProcess>();
            string     path        = System.IO.Path.Combine(folder, processName);

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                process.Save(cn, path, null, false);
            }

            return(new
            {
                server = WebConfigurationManager.AppSettings["BPMServerName"],
                path = path,
                version = process.Version.ToString(2)
            });
        }