如何使用Excel文件在Drools中编写字母数字范围的规则 [英] How to write a rule for alphanumeric ranges in Drools using excel file

查看:196
本文介绍了如何使用Excel文件在Drools中编写字母数字范围的规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Drools的新手,所以如果这个问题看起来很愚蠢,请原谅我。我已经为数值范围的数值编写了规则。有人可以告诉我如何为字母数字范围编写规则。

下面是我为数字范围编写的规则。

I'm new to Drools, so pardon me if the question seems stupid. I have written rules for values which have ranges in numeric format. Can someone please let me know how can we write rules for alphanumeric ranges.

Below is the rule I've written for numeric ranges.

claim.Medicalcare.get("CLM07-00").Value >= $1,
claim.Medicalcare.get("CLM07-01").Value <= $2

以上规则适用于1-9之间的值。

我需要编写一个规则,其值应为G0129-G2341,M9867,99234-99350。
我正在Excel电子表格中编写这些规则。

The above rule is for values ranging 1-9.

I need to write a rule which has values G0129-G2341,M9867,99234-99350.
I'm writting these rules in excel spreadsheet.

推荐答案

假定该字段是 java.lang.String ,您也可以对这些值使用> > = 等,并为String范围写一个范围

Assuming that the field is a java.lang.String, you can use >, >= etc. for these values as well and write a range for String ranges the same way you do for numeric values.

如果您有多个范围,请为每个范围使用一行。 (您也可以按照文档中的描述使用forall构造。)

If you have several ranges, use one line for each range. (You may also use the forall construct as described in the documentation.)

对于多个单独的值,可以在$$ c中使用运算符

For several individual values you can use the operator in or, again, the forall construct.

没有简单的方法可以测试范围和单个值的任意组合。您必须将 G0129-G2341,M9867、99234-99350 的测试分成两个或三个规则。

There is no simple way of testing for an arbitrary combination of ranges and individual values. You'll have to split testing for G0129-G2341, M9867, 99234-99350 into two or three rules.

(您没有提供任何描述事实的代码-这就是为什么我也没有提供任何代码。)

(You didn't provide any code describing the fact - this is why I don't provide any code either.)

这篇关于如何使用Excel文件在Drools中编写字母数字范围的规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆