private void LoadObjectsTable(string objectsXml) { if (m_CondtionObjectsLookup == null) m_CondtionObjectsLookup = new Hashtable(); m_ObjectMetadata = new Hashtable(); m_CachedActions = new CachedActions(); m_CondtionObjectsLookup["this"] = this; m_CondtionObjectsLookup["helper"] = new PolicyProcessorHelper(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(objectsXml); XmlNode condtitionNode = xmlDoc.SelectSingleNode("/PolicyObjects/Conditions"); if (condtitionNode == null) { //Compatibility mode condtitionNode = xmlDoc.SelectSingleNode("/PolicyObjects"); } LoadConditionObjects(condtitionNode); m_ActionNode = xmlDoc.SelectSingleNode("/PolicyObjects/Actions"); }
/// <summary> /// </summary> public void Initialise(RunAt runat, string rulesXml, string objectsXml) { try { if (m_CachedActions != null && m_CachedActions.Count > 0) m_CachedActions = new CachedActions(); if (m_PolicySetCache == null || !m_PolicySetCache.IsAlreadyCached(rulesXml, objectsXml)) { m_PolicySetCache = new PolicySetCache(rulesXml, objectsXml); CurrentRunAtMode = runat; LoadObjectsTable(objectsXml); } m_NxBre = GetBREForRules(rulesXml); LoadPresetActionsInfo(rulesXml); InitialiseObjects(); InitialiseFactories(); } catch (Exception ex) { Logger.LogError(ex); m_CachedActions = null; m_PolicySetCache = null; m_NxBre = null; throw ex; } }