in drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/session/FactTypeBenchmark.java [91:108]
public int fireAllRules() throws IllegalAccessException, InstantiationException {
for (int i = 0; i < typesNr; i++) {
FactType factType = kieBase.getFactType( "org.test", "Fact" + i );
Object fact = factType.newInstance();
factType.set(fact, "name", "x");
factType.set(fact, "value", 1);
if (useNotExistingField) {
factType.set(fact, "notExisting", 2);
}
kieSession.insert(fact);
}
int result = kieSession.fireAllRules();
if (result != typesNr) {
throw new RuntimeException( "Wrong number of fired rules, expected: " + typesNr + ", actual: " + result );
}
return result;
}