com.sample.reference.drl Maven / Gradle / Ivy
package com.sample
import com.sample.DroolsMain.Bar;
import com.sample.DroolsMain.Foo;
import java.util.concurrent.atomic.AtomicInteger;
global AtomicInteger barCount;
global AtomicInteger fooCount;
rule "DuplicateBars"
dialect "java"
when
f1 : Foo( bar != null )
f2 : Foo( this != f1, bar != null, bar == f1.bar )
then
barCount.incrementAndGet();
end
rule "DuplicateFoos"
dialect "java"
when
b1 : Bar( foo != null )
b2 : Bar( this != b1, foo != null, foo == b1.foo )
then
fooCount.incrementAndGet();
end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy