You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rule "cycle"
when
o1 : Object1( !Objects.isNull(field1) )
then
modify( o1 ) {
setField2( "U" )
}
end
With drools 8.44.0.Final, this rule causes a infinite loop, because in MVELConstraint.calculateMaskFromExpression, if firstProp (in this case, Objects) is not resolved as a fact's property, it results in allSetBitMask.
However, if we use static import,
import static java.util.Objects.isNull;
rule "cycle"
when
o1 : Object1( !isNull(field1) )
then
System.out.println("Rule cycle fired");
modify( o1 ) {
setField2( "U" )
}
end
Do we need such firstProp restriction? Consider use cases which requires firstProp and backward compatibility impact. Maybe we can check all props and then use allSetBitMask only when there is no valid prop.
Of course, also consider the consistency with exec-model.
The text was updated successfully, but these errors were encountered:
https://kie.zulipchat.com/#narrow/stream/232677-drools/topic/Static.20method.20in.20LHS
With drools 8.44.0.Final, this rule causes a infinite loop, because in
MVELConstraint.calculateMaskFromExpression
, iffirstProp
(in this case,Objects
) is not resolved as a fact's property, it results in allSetBitMask.However, if we use static import,
we can work around the problem and make it property reactive for only
field1
. (Method call arguments are reactive since 7.46.0 : https://docs.drools.org/7.73.0.Final/drools-docs/html_single/#better-property-reactivity )Do we need such
firstProp
restriction? Consider use cases which requiresfirstProp
and backward compatibility impact. Maybe we can check all props and then use allSetBitMask only when there is no valid prop.Of course, also consider the consistency with exec-model.
The text was updated successfully, but these errors were encountered: