我是drools的新手。我正在使用5.6.0版本的drools。我想在变量满足某些条件时将一个int值添加到ArrayList中。
package com.sample
import com.sample.PojoDRLListIteration;
import java.util.ArrayList;
import java.util.List;
rule "Available firmwares for hardware 3"
salience 61
when
PojoDRLListIteration: PojoDRLListIteration($listOfHardware: listOfHardware)
hardware_version:Integer() from $listOfHardware
PojoDRLListIteration1: PojoDRLListIteration($x: Hardwaretobechecked && $x == 3)
PojoDRLListIteration2: PojoDRLListIteration($listOfFirmware: listOfFirmware)
firmware_version: Double() from $listOfFirmware
PojoDRLListIteration($listOfAddons : listOfAddons)
Addon_version: Double() from $listOfAddons
$l2: ArrayList()
$finalresult: PojoDRLListIteration(hardware_version >= 3 &&
firmware_version > 1.2 &&
Addon_version >= 1.1 )
then
$l2.add(hardware_version);
System.out.println("value added"+$l2.get(0));
end
控件未进入当时部分。提前谢谢。