首页 > 代码库 > SNF快速开发平台--规则引擎在程序当中如何调用

SNF快速开发平台--规则引擎在程序当中如何调用

规则定义完如何在程序当中进行使用呢?

其时很简单,只需要如下代码就可以调用程序:

规则定义:

技术分享

调用代码:

#region 演示2:生成左表数据(规则) POST: /api/DEMO/DemoSingleTable/CreateRuleLeftTable        /// <summary>        /// 演示2:生成左表数据(规则) POST: /api/DEMO/DemoSingleTable/CreateRuleLeftTable        /// </summary>        /// <param name="data">数据</param>        /// <returns>提示信息</returns>        [System.Web.Http.HttpPost]        public dynamic CreateRuleLeftTable(dynamic data)        {            if (data != null)            {                Dictionary<string, object> parames = new Dictionary<string, object>();                Dictionary<string, object> returns = new Dictionary<string, object>();                parames.Add("data",data);                RuleService ruleService = (RuleService)SSession.GetSession("RuleService");                returns = ruleService.Execute(this.UserInfo, "生成关联DEMO右表数据主规则", parames, this.DbHelper, this.UserCenterDbHelper);                if (returns != null)                {                    return ShowWarning(AppMessage.MSG0011);                }                if (BaseSystemInfo.ShowInformation)                {                    return ShowErrorWarning(AppMessage.MSG3020);                }            }            return ShowErrorWarning("参数不对!");        }        #endregion

 

SNF快速开发平台--规则引擎在程序当中如何调用