gpt4 book ai didi

java - Drools 不能对 DRL 中的函数参数使用泛型类型

转载 作者:行者123 更新时间:2023-11-30 10:08:33 25 4
gpt4 key购买 nike

我正在我的 DRL 上定义下一个函数

function void embargarMultiplesCuentasJudicial(ArrayList<Cuenta> cuentas, Embargo embargo,BigDecimal montoTotal ,BigDecimal limite) {
//BODY
}

我收到这个错误:

Unable to resolve type ArrayList<Cuenta> while building function. java.lang.ClassNotFoundException: Unable to find class 'ArrayList<Cuenta>' ]]

但是我在 top 的文件中导入了 ArrayList 和 Cuenta

import modelo.Cuenta;
import modelo.Embargo;
import java.util.ArrayList;

最佳答案

似乎您无需提及您的 ArrayList 在参数中使用的内容。以下示例对我来说效果很好(它是自定义对象的 ArrayList):

function testFunction(ArrayList al)
{
System.err.println("Called a function with the ArrayList : " + java.util.Arrays.toString(al.toArray()));
}

关于java - Drools 不能对 DRL 中的函数参数使用泛型类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53710010/

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