Michał Dąbrowski

Unknown value in "satisfies" clause after "such that" returned empty collection

Discussion created by Michał Dąbrowski on May 23, 2012
Latest reply on Jun 2, 2012 by Michał Dąbrowski

Hi,

 

I'm using Blaze Advisor 8.10 for Java.

this code:

 

-----------------

scarray is some array of SideCost initially an array of SideCost;

 

sc1 is some SideCost initially a SideCost;
sc1.name = "A";
sc1.amount = 100;
scarray.append(sc1);

 

sc2 is some SideCost initially a SideCost;
sc2.name = "A";
sc2.amount = 200;
scarray.append(sc2);

 

sc3 is some SideCost initially a SideCost;
sc3.name = "B";
sc3.amount = 400;
scarray.append(sc3);

 

if(every SideCost in scarray
such that it.name="C"
satisfies it.amount > 150) then
print("SATISFIES");

-----------------

 

produces this error:

 

 

com.blazesoft.engines.rules.NdEvaluationException: Evaluation error
Expression produces unexpected value: unknown.
unknown while evaluating every SideCost in scarray such that (it.name = "C") satisfies (it.amount > 150)

 

if I change |such that it.name="C"| to A or B everything works fine.

Seems, that "satisifies" clause fails if "such that" returns empty collection.

But the file "developingRuleProjects.pdf", page 389, section "limiting the set of objects to match" states, that the test expression is evaulated only on the objects, that satisfy constraint expression. Since with my example this is 0 objects, the "satisfy" clause should never be evaulated. Am I right?

How can I rewrite my code to work properly?


Outcomes