コード例 #1
0
        public void RaiseCallbackEvent(string eventArgument)
        {
            Security.Token tok = (Security.Token)Page.Session["Token"];
            if (tok != null && tok.Authenticated && tok.GetCurrentUser().Registered)
            {
                List <Security.WorkflowReference> editableWf = Page.Session["WorkflowReferenceList"] as List <Security.WorkflowReference>;
                Security.WorkflowReference        model      = editableWf[Int32.Parse(eventArgument)];
                if (model != null)
                {
                    //TOCHANGE: now can edit only ONE workflow >>>>>alla volta<<<<< LOL
                    string wfID = "workflow_1"; //model.GetWorkflowName();
                    result = "OK&" + wfID;
                    Workflow wf = model.GetWorkflow();
                    Page.Session[wfID] = wf;

                    //To can publish
                    Page.Session["WFE_CurrentWorkflowReference"] = model;

                    //Recovering wf's nodes
                    foreach (WFnode n in wf.GetNodes())
                    {
                        Page.Session[n.Name] = n;
                    }
                }
                else
                {
                    result = "Model" + model.GetWorkflowName() + " not found&";
                }
            }
            else
            {
                result = "User not logged in&";
            }
        }
コード例 #2
0
        public void RaiseCallbackEvent(string eventArgument)
        {
            result = "";
            Security.Token tok = (Security.Token)Page.Session["Token"];
            if (tok != null && tok.Authenticated && tok.GetCurrentUser().Registered)
            {
                List <Security.WorkflowReference> editableWf = Page.Session["WorkflowReferenceList"] as List <Security.WorkflowReference>;
                Security.WorkflowReference        model      = editableWf[Int32.Parse(eventArgument)];
                if (model != null)
                {
                    //TOCHANGE: now can edit only ONE workflow alla volta
                    string wfID = "workflow_1"; //model.GetWorkflowName();
                    result = wfID;

                    Workflow wf = model.GetWorkflow();
                    Page.Session[wfID] = wf;

                    //To can publish
                    Page.Session["WFE_CurrentWorkflowReference"] = model;

                    //Recovering wf's nodes
                    int i = 1;
                    foreach (WFnode n in wf.GetNodes())
                    {
                        Page.Session[wfID + "_node_" + i++] = n;
                    }
                }
                else
                {
                    result = "Model" + model.GetWorkflowName() + " not found";
                }
            }
            else
            {
                result = "User not logged in";
            }
            result = result + "\\//";
            List <Security.Service> service_list = Security.ExternalService.List();
            int count = 0;

            foreach (Security.Service s in service_list)
            {
                result += s.ServiceName + "\\|//" + s.ServiceId;
                count++;
                if (count < service_list.Count)
                {
                    result += "\\||//";
                }
            }
        }