⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dotnetconditionfactory.cs

📁 drools 一个开放源码的规则引擎
💻 CS
字号:
using System;
using org.drools.rule;
using org.drools.smf;
using org.drools.spi;

namespace org.drools.semantics.dotnet
{
	/// <summary>
	/// .NET Condition Factory
	/// </summary>
	public class DotNetConditionFactory : ConditionFactory
	{
		public Condition[] newCondition(Rule r, RuleBaseContext rbc, Configuration c)
		{
			try
			{
				int id = 0;
				if (rbc.get("dotnet-condition-id") != null)
				{
					id = (int)rbc.get("dotnet-condition-id");
				}
				id++;
				rbc.put("dotnet-condition-id", id);
				
				return new Condition[] { new DotNetCondition(r, id, c.getText()) };
			}
			catch (Exception e)
			{
				throw new FactoryException(e);
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -