I have asserted one ArrayList<Cylinder> into my working memory
and I am using the 'from' clause to iterate over the items of the list and
fire the rule accordingly.
rule "Firing Pressure Less Than Min"
$cylinder : Cylinder(pressureValue < Pressure.MIN_VALUE) from $cylinders
System.out.println("The FP of Cyl xxx is Lower than Min Possible.");
I would like to make the following questions:
a) Is it possible to get the index of the item in the list for which the rule fired;
Lets say that I would like to do that without adding extra fields in the Cylinder class.
b) If i had a second ArrayList<Cylinder> in my working memory would I be able to
the two lists simultaneously and compare values for corresponding items in the LHS;
c) Can I use the 'from accumulate' clause over an ArrayList instead of individual
asserted into the working memory;
My apologies for the multiple questions in one mail.
Thank you in advance for any help,
Show replies by thread