Unable to get the results from Biztalk BRE after executing a policy.

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Unable to get the results from Biztalk BRE after executing a policy.

Viewing 0 reply threads
  • Author
    Posts
    • #18593

      Created two c# classes for accessing rule engine and names are helperclass and other one with IFactCreator implementation.Created policy in BRE composer with simple condition and it will return a string value as output.Rule Engine always returns null to variable Test2 instead of “Match found” and let me know the missing steps for resolving this issue.1.Form Content:Helper oHelper = new Helper();Microsoft.RuleEngine.Policy policy = new Microsoft.RuleEngine.Policy(“Myrule”);object[] fact = new object[1];fact[0] = (object) oHelper.Test1.Rows[0][0];policy.Execute(fact);Text1.Text = oHelper.Test2;2. HelperClass Content:[Serializable]public class Helper{        private DataTable dt;        public Helper()        {             dt = new DataTable(“Test”);        }                public DataTable Test1                {                        get                         {                return dt;                        }                        set                         {                dt = value;                        }                }        private string test2;        public string Test2        {            get            {                return test2;            }            set            {                test2 = value;            }        }    }3. IFactCreator Implementation:public class Converter : Microsoft.RuleEngine.IFactCreator{        private object[] Facts;        public Converter()        {        }        public int stringToInt32(string value)        {            return Int32.Parse(value);        }        #region IFactCreator Members        public object[] CreateFacts(RuleSetInfo ruleSetInfo)        {            Facts = new object[1];            Facts.SetValue(new Helper(), 0);            return Facts;         }        public Type[] GetFactTypes(RuleSetInfo ruleSetInfo)        {            Type[] TCon = new Type[1];            TCon[0] = new Helper().GetType();            return TCon;        }        #endregion }4. BRE Composer Info:Policy & Rule created using BRE composer and condition info is below.If (string value from vocabulary) is equal to (NY) then return string “Match found”

       

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.