gpt4 book ai didi

流口水错误 : Unable to find @positional field

转载 作者:行者123 更新时间:2023-12-04 12:03:41 25 4
gpt4 key购买 nike

我创建了一个流口水文件 PersonTotalAccountsBalance.drl 如下。我是规则引擎世界的初学者。

package com.auhuman.rules;

import com.auhuman.Person;
import com.auhuman.Account;

function float getTotalBalance(Person person) {
float totalBalance = 0;
for (Account account : person.getAccounts()){
totalBalance += account.getBalance();
}
return totalBalance;
}

rule "PersonTotalAccountsBalance"
when
$node : Person(active == true)
then
float totalBalance = getTotalBalance($node)

modify($node) {
setTotalBalance(totalBalance);
}
end

编译后我得到以下错误
Unable to compile the file: PersonTotalAccountsBalance.drl. Errors = [Unable to find @positional field 0 for class Person
: [Rule name='PersonTotalAccountsBalance']
]

最佳答案

虽然这个答案很旧:
我有同样的错误消息,但我正在处理 xls 中的决策表(excel) 格式。表看起来是这样的:
merged cells
请注意 $order:Order在合并的单元格中跨越 CONDITIONACTION列。该单元格只允许高于 CONDITION表,而不是 ACTION表。取消合并后,我不再收到错误消息:
unmerged cells
ACTION 中定义错误的值时,我遇到了非常相似的错误用于设置属性的列。当对 String 使用不带引号的值时模型中的属性 Order我收到以下错误:

Unable to get KieModule, Errors Existed: Error Messages:
Message [id=1, kieBase=defaultKieBase, level=ERROR, path=status_rules/status.xls, line=21, column=0
text=Rule Compilation error The method setNextStatus(String) in the type Order is not applicable for the arguments (int)]
Message [id=2, kieBase=defaultKieBase, level=ERROR, path=status_rules/status.xls, line=5, column=0
text=Rule Compilation error The method setNextStatus(String) in the type Order is not applicable for the arguments (int)]
Message [id=3, kieBase=defaultKieBase, level=ERROR, path=status_rules/status.xls, line=13, column=0
text=Rule Compilation error The method setNextStatus(String) in the type Order is not applicable for the arguments (int)]
但是,在这种情况下,错误消息要精确得多。

关于流口水错误 : Unable to find @positional field,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49546878/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com