Beispiel #1
0
        /// <summary>
        /// Loads a biz rule from a file
        /// </summary>
        /// <param name="path">path of the script to load</param>
        /// <param name="language">language to use for the rule</param>
        public void LoadBizRuleScript(string path, BizRuleLanguage language)
        {
            if (language == AzAlternative.BizRuleLanguage.Undefined)
            {
                throw new AzException("Undefined cannot be set for the script language.");
            }

            Instance.LoadBizRuleScript(path, language);
        }
Beispiel #2
0
        public override DirectoryRequest[] GetUpdate()
        {
            var           result = base.GetUpdate();
            ModifyRequest mr     = (ModifyRequest)result[result.Length - 1];

            SetAttribute(mr.Modifications, BIZRULE, BizRule);
            SetAttribute(mr.Modifications, BIZRULELANGUAGE, BizRuleLanguage.ToString());
            SetAttribute(mr.Modifications, BIZRULEPATH, BizRuleImportedPath);

            Changes.Clear();
            return(result);
        }
Beispiel #3
0
        protected override System.DirectoryServices.Protocols.AddRequest CreateNewThis()
        {
            AddRequest ar = base.CreateNewThis();

            if (!string.IsNullOrEmpty(BizRule))
            {
                ar.Attributes.Add(CreateAttribute(BIZRULE, BizRule));
                ar.Attributes.Add(CreateAttribute(BIZRULELANGUAGE, BizRuleLanguage.ToString()));
                ar.Attributes.Add(CreateAttribute(BIZRULEPATH, BizRuleImportedPath));
            }

            return(ar);
        }
Beispiel #4
0
 public void LoadBizRuleScript(string path, BizRuleLanguage language)
 {
     BizRule             = BizRuleLoader.LoadScript(path);
     BizRuleImportedPath = path;
     BizRuleLanguage     = language;
 }
Beispiel #5
0
        public override XmlElement ToXml()
        {
            XmlElement e = base.ToXml();

            SetAttribute(e, NAME, Name);
            SetAttribute(e, DESCRIPTION, Description);

            SetAttribute(e, BIZRULEPATH, BizRuleImportedPath);

            SetElement(e, BIZRULELANGUAGE, BizRuleLanguage == AzAlternative.BizRuleLanguage.Undefined ? null : BizRuleLanguage.ToString());
            SetElement(e, BIZRULE, BizRule);

            return(e);
        }
Beispiel #6
0
        public override XmlElement ToXml(XmlElement parent)
        {
            XmlElement e = parent.OwnerDocument.CreateElement(ELEMENTNAME);

            SetAttribute(e, GUID, Key);
            SetAttribute(e, NAME, Name);
            SetAttribute(e, DESCRIPTION, Description);

            SetAttribute(e, BIZRULEPATH, BizRuleImportedPath);
            SetElement(e, BIZRULELANGUAGE, BizRuleLanguage == AzAlternative.BizRuleLanguage.Undefined ? null : BizRuleLanguage.ToString());
            SetElement(e, BIZRULE, BizRule);

            parent.AppendChild(e);

            return(e);
        }