如果流口水规则文件是红色但可以运行的怎么办?尽管它可以运行,但是红色的对象可以在当时呼叫属性吗?

发布于 2025-01-24 07:43:06 字数 159 浏览 2 评论 0原文

如果流口水规则文件是红色但可以运行的怎么办?尽管它可以运行,但是红色的对象无法在“然后”中调用属性? 在此处输入图像描述

What if the drools rule file is red but can run? Although it can run, the object that is red can't call properties in 'then'?
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一袭水袖舞倾城 2025-01-31 07:43:06

流口水是文本文件。他们没有颜色。

无论它是什么,您的IDE似乎都有一个提供验证的流口水插件。如果您有有效的流口水,并且插件显示某种“无效”指示,则应向IDE提交错误。

就您的实际规则而言,IDE是正确的,因为您的自我参考无效。您不能声明一个变量,并在该自我标记声明中参考相同的变量

$eventA: Person(this != $eventB, $eventA.age > $eventB.age, this after[0s, 2s] $eventB) from entry-point "ATM"
                                 ^^^^^^^^
                                 You can't refer to $eventA here! It's not declared! 

$eventA: Person(this != $eventB, age > $eventB.age, this after[0s, 2s] $eventB) from entry-point "ATM"

Drools are text files. They have no colors.

Your IDE, whatever it is, appears to have a Drools plugin that affords validation. If you have valid Drools, and the plugin shows some sort of 'invalid' indication, you should file a bug with the IDE.

In terms of your actual rule, the IDE is correct because you have an invalid self-reference. You can't declare a variable and refer to that same variable in that selfsame declaration.

That is, this is wrong:

$eventA: Person(this != $eventB, $eventA.age > $eventB.age, this after[0s, 2s] $eventB) from entry-point "ATM"
                                 ^^^^^^^^
                                 You can't refer to $eventA here! It's not declared! 

Correct syntax is this:

$eventA: Person(this != $eventB, age > $eventB.age, this after[0s, 2s] $eventB) from entry-point "ATM"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文