/// <summary> /// Receives client's call and adds a node in the workflow /// </summary> /// <param name="eventArgument">WorkflowId & Node id</param> public void RaiseCallbackEvent(string eventArgument) { try { string[] args = eventArgument.Split('&'); string wfID = args[0]; string nodeID = args[1]; string nodeName = args[2]; callbackResult = "OK"; //Creating the new node //WFnode node = new WFnode(nodeID); WFnode node = BrowserWithServerSync.CreateServerNode(args[3]); Page.Session[nodeName] = node; //Adding node to the WF Workflow wf = (Workflow)Page.Session[wfID]; wf.WorkflowInvalidationEvent += new EventHandler <WorkflowValidationEventArgs>(wf_WorkflowInvalidationEvent); wf.AddNode(node); } catch (Exception e) { Console.Write(e.Message); callbackResult = e.Message; } }
/// <summary> /// Receives client's call and creates a new Workflow /// </summary> /// <param name="eventArgument">WorkflowId from client</param> public void RaiseCallbackEvent(string eventArgument) { try { string wfID = eventArgument; if (Page.Session[wfID] == null) { throw new Exception("Workflow with ID == " + wfID + " does not exist!"); } Workflow wf = (Workflow)Page.Session[wfID]; string xmlDoc = BrowserWithServerSync.GetXMLDocument(wf); if (xmlDoc.Contains("TEXT") || xmlDoc.Contains("IMAGE") || xmlDoc.Contains("HTMLCODE")) { Page.Session["UsingStaticFields"] = true; } else { Page.Session["UsingStaticFields"] = false; } callbackResult += "OK|" + wfID + '|' + xmlDoc; } catch (Exception e) { callbackResult = e.Message; } }
/// <summary> /// Receives client's call and syncs a node in the workflow /// </summary> /// <param name="eventArgument">WorkflowId & Node id</param> public void RaiseCallbackEvent(string eventArgument) { try { string[] args = eventArgument.Split('&'); string wfID = args[0]; string nodeID = args[1]; string nodeName = args[2]; callbackResult = "OK"; //Registering to wf's events Workflow wf = (Workflow)Page.Session[wfID]; wf.WorkflowInvalidationEvent += new EventHandler <WorkflowValidationEventArgs>(wf_WorkflowInvalidationEvent); //Creating the new node //WFnode node = new WFnode(nodeID); WFnode node = (WFnode)Page.Session[nodeName]; //This solves the bug of apostrophes and other charachter wich use & in the coding string to_sync = ""; for (int k = 3; k < args.Length; k++) { to_sync += args[k]; if (k < args.Length - 1) { to_sync += '&'; } } //BrowserWithServerSync.SyncServerNode(args[2], node); BrowserWithServerSync.SyncServerNode(to_sync, node); } catch (Exception e) { callbackResult = e.Message; } }