需要检查在Drools决策表中配置的值是否在范围内(上限和下限)
我是流口水的新手。现在,我需要验证一个值在Drools决策表中配置的范围内。
方案:薪水是条件,等级是行动(输出)。
我需要这样的薪水 (0-10000) - A级, (10000-15000) - B级,
请帮助我设计流口水决策表。 我可以使用“”
I am new to Drools. Now I need to validate one value is within the range configured in drools decision table.
Scenario: Salary is the condition and grade is the action (output).
I need to configure the salary like this
(0 - 10000) - Grade A,
(10000 - 15000) - Grade B
Please help me to design the drools decision table.
Can I use "in"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将使用
<
和>
(或< =
and> =
)就像您一样'D在Java或DRL中进行正常比较。伪代码,它看起来像这样:
中的
是流口水中的有效关键字,但这不是为此。它是用于确定是否在给定列表中的值。例如,如果您想检查一些值$颜色是红色,蓝色或绿色的颜色,则您会喜欢:
$ color(“红色”,“蓝色”,“绿色”)。不适合弄清楚一个数字是否在范围内。
You'd use
<
and>
(or<=
and>=
) just like you'd do a normal comparison in Java or DRL.Pseudo-code, it would look something like this:
in
is a valid keyword in Drools, but it's not for this. It's for identifying if a value is in a given list. For example, if you wanted to check that some value $color is one of red, blue, or green, you'd do like:$color in ("red", "blue", "green")
. It's not appropriate for figuring out if a number is in a range.