At least in some cases, parametrized patterns/rules do not work as expected unless api.getGTEngine().setAlwaysUpdatePrior(true); is set.
Example rule:
rule findItemByName(name: EString) {
[=] recipe: Recipe {
[=] -item -> items
}
[=] items: Item {
}
[#] items.name == parameter.name;
};
If there is an element in the model, that is of type Item and has the name abc, this assert fails:
[...]
assertEquals(1, api.findItemByName("abc").countMatches());
On the other hand, this assert succeeds:
[...]
api.getGTEngine().setAlwaysUpdatePrior(true);
assertEquals(1, api.findItemByName("Flour").countMatches());