public static CatalogRuleApplicationReference GetCatalogRuleAppReference(RuleExecutionInfo ruleExecutionInfo)
        {
            var ruleapp = new CatalogRuleApplicationReference(ruleExecutionInfo.CatalogUri, ruleExecutionInfo.RuleAppName, ruleExecutionInfo.Username, ruleExecutionInfo.Password);

            ruleapp.SetRefresh(ruleExecutionInfo.CatalogRefreshInterval);
            ruleapp.ConnectionTimeout = ruleExecutionInfo.CatalogRuleAppTimeoutInterval;
            return(ruleapp);
        }
        public static IEnumerable <string> GetRuleApplicationListFromCatalog(RuleExecutionInfo ruleExecutionInfo)
        {
            var ruleApps = new List <string>();

            using (var conn = GetCatalogConnection(ruleExecutionInfo))
            {
                conn.GetAllRuleApps().ToList().ForEach(r => ruleApps.Add(r.Key.Name));
            }

            return(ruleApps);
        }
 public static RuleApplicationDef GetRuleApplicationDefFromCatalog(RuleExecutionInfo ruleExecutionInfo)
 {
     return(GetCatalogRuleAppReference(ruleExecutionInfo).GetRuleApplicationDef());
 }
 public static RuleApplicationDef GetRuleApplicationDefFromFile(RuleExecutionInfo ruleExecutionInfo)
 {
     return(RuleApplicationDef.Load(ruleExecutionInfo.RuleAppFilePath));
 }
 public static FileSystemRuleApplicationReference GetFileRuleAppReference(RuleExecutionInfo ruleExecutionInfo)
 {
     return(new FileSystemRuleApplicationReference(ruleExecutionInfo.RuleAppFilePath));
 }
 public static RuleCatalogConnection GetCatalogConnection(RuleExecutionInfo ruleExecutionInfo)
 {
     return(new RuleCatalogConnection(new Uri(ruleExecutionInfo.CatalogUri), new TimeSpan(0, 0, 60), ruleExecutionInfo.Username, ruleExecutionInfo.Password));
 }