dotnetconditionfactory.cs
来自「drools 一个开放源码的规则引擎」· CS 代码 · 共 34 行
CS
34 行
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 + =
减小字号Ctrl + -
显示快捷键?