Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            query = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&title={4}&flowid={5}&sender={6}&date1={7}&date2={8}&iframeid={9}&openerid={10}&taskid={11}",
                                  Request.QueryString["flowid"],
                                  Request.QueryString["groupid"],
                                  Request.QueryString["appid"],
                                  Request.QueryString["tabid"],
                                  Request.QueryString["title"].UrlEncode(),
                                  Request.QueryString["flowid"],
                                  Request.QueryString["sender"],
                                  Request.QueryString["date1"],
                                  Request.QueryString["date2"],
                                  Request.QueryString["iframeid"],
                                  Request.QueryString["openerid"],
                                  Request.QueryString["taskid"]
                                  );
            flowid       = Request.QueryString["flowid"];
            groupid      = Request.QueryString["groupid"];
            taskid       = Request.QueryString["taskid"];
            displayModel = Request.QueryString["displaymodel"];
            if (!taskid.IsGuid())
            {
                return;
            }
            var task = bworkFlowTask.Get(taskid.ToGuid());

            if (task == null || !task.SubFlowGroupID.HasValue)
            {
                return;
            }
            var subFlowTasks = bworkFlowTask.GetTaskList(Guid.Empty, task.SubFlowGroupID.Value);

            if (subFlowTasks.Count == 0)
            {
                return;
            }

            wfInstall = bworkFlow.GetWorkFlowRunModel(subFlowTasks.First().FlowID);
            tasks     = subFlowTasks.OrderBy(p => p.Sort).ThenBy(p => p.ReceiveTime);
            flowid    = subFlowTasks.First().FlowID.ToString();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            flowid       = Request.QueryString["flowid1"] ?? Request.QueryString["flowid"];
            groupid      = Request.QueryString["groupid"];
            displayModel = Request.QueryString["displaymodel"];

            wfInstall = bworkFlow.GetWorkFlowRunModel(flowid);
            tasks     = bworkFlowTask.GetTaskList(flowid.ToGuid(), groupid.ToGuid()).OrderBy(p => p.Sort).ThenBy(p => p.ReceiveTime);
            query     = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&title={4}&flowid={5}&sender={6}&date1={7}&date2={8}&iframeid={9}&openerid={10}",
                                      flowid, groupid,
                                      Request.QueryString["appid"],
                                      Request.QueryString["tabid"],
                                      Request.QueryString["title"].UrlEncode(),
                                      Request.QueryString["flowid"],
                                      Request.QueryString["sender"],
                                      Request.QueryString["date1"],
                                      Request.QueryString["date2"],
                                      Request.QueryString["iframeid"],
                                      Request.QueryString["openerid"]
                                      );
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WebForm.Common.Tools.CheckLogin(false);
            string params1 = Request.Form["params"];

            if (params1.IsNullOrEmpty())
            {
                Response.Write("参数为空!");
                Response.End();
            }
            string instanceid = Request.QueryString["instanceid"] ?? Request.Form["instanceid"];

            string flowid      = Request.QueryString["flowid"];
            var    wfInstalled = bworkFlow.GetWorkFlowRunModel(flowid);

            if (wfInstalled == null)
            {
                Response.Write("未找到流程运行时实体,请确认流程是否已安装!");
                Response.End();
            }
            string comment = Request.Form["comment"];


            string stepid = Request.QueryString["stepid"];

            var opationJSON = LitJson.JsonMapper.ToObject(params1);

            //流程标题
            string title   = Request.Form[Request.Form["Form_TitleField"]];
            var    execute = CreateExecute(instanceid, flowid, wfInstalled, comment, stepid, opationJSON, title);
            //操作roomis审核
            //if (execute.ExecuteType == EnumType.ExecuteType.Completed)
            //   new WebForm.Common.Meet().Roomis(execute.InstanceID, WebForm.Common.RoomisOperation.put_approve);

            var eventParams = WorkFlowCustomEventParamsSet(execute);


            //保存业务数据 "1" != Request.QueryString["isSystemDetermine"]:当前步骤流转类型如果是系统判断,则先保存数据,在这里就不需要保存数据了。
            if ((execute.ExecuteType == (EnumType.ExecuteType.Save | EnumType.ExecuteType.Completed)) ||
                "1" != Request.QueryString["isSystemDetermine"])
            {
                instanceid = bworkFlow.SaveFromData(instanceid, eventParams);
                if (execute.InstanceID.IsNullOrEmpty())
                {
                    execute.InstanceID     = instanceid;
                    eventParams.InstanceID = instanceid;
                }
            }

            Response.Write("执行参数:" + params1 + "<br/>");

            var steps = wfInstalled.Steps.Where(p => p.ID == execute.StepID);

            eventParams = firstevent(execute.ExecuteType, eventParams, steps);//提交前,退回前事件处理

            //处理委托
            execDelegation(execute);
            //处理流程
            var reslut = btask.Execute(execute);

            Response.Write(string.Format("处理流程步骤结果:{0}<br/>", reslut.IsSuccess ? "成功" : "失败"));
            Response.Write(string.Format("调试信息:{0}", reslut.DebugMessages));
            setLogs(params1, wfInstalled.Name, reslut);

            eventParams = NextEvent(execute, eventParams, steps);//提交后,退回后事件处理

            //归档
            WorkFlowArchives(wfInstalled, title, execute);

            Response.Write("<script type=\"text/javascript\">top.getTaskCount();alert('" + reslut.Messages + "');top.mainDialog.close();</script>");

            if (reslut.IsSuccess)
            {
                RoomisSend(execute, reslut);
                backEnd(execute);
                DisplayHtml(reslut);
            }
        }