void Execute(Uii.Csr.RequestActionEventArgs args) { /* * <Controls> * <JAccControl name="clickme" action="click"> * <Path> * <NextName offset = "1">Click Me</NextName> * </Path> * </JAccControl> * </Controls> */ string parameterdata = Utility.GetContextReplacedString(args.Data, CurrentContext, localSession); XmlDocument doc = new XmlDocument(); doc.LoadXml(parameterdata); foreach (XmlNode nodeControl in doc.SelectSingleNode("//Controls").ChildNodes) ///JAccControl or AccControl { using (IUSDAutomationObject automationObject = automationEngine.GetAutomationObject(nodeControl)) { try { string controlAction = AutomationControl.GetAttributeValue(nodeControl, "action", ""); automationEngine.Execute(automationObject, controlAction); } catch (Exception ex) { LogWriter.Log(ex); } } } }
void SetValue(Uii.Csr.RequestActionEventArgs args) { string parameterdata = Utility.GetContextReplacedString(args.Data, CurrentContext, localSession); XmlDocument doc = new XmlDocument(); doc.LoadXml(parameterdata); foreach (XmlNode nodeControl in doc.SelectSingleNode("//Controls").ChildNodes) ///JAccControl or AccControl { using (IUSDAutomationObject automationObject = automationEngine.GetAutomationObject(nodeControl)) { try { string controlValue = AutomationControl.GetAttributeValue(nodeControl, "value", ""); automationEngine.SetValue(automationObject, controlValue); } catch (Exception ex) { LogWriter.Log(ex); } } } }