Jim
Jim

Reputation: 22656

Drools Planner rule only fired once

I have a rule of the form

rule "notBar"
    when
        $foo : Foo(bar == false)
    then
        insertLogical(new IntConstraintOccurrence("notBar", ConstraintType.NEGATIVE_SOFT,
                $foo));
end

I expect to see this fired once for every Foo with bar being false however the rule is only fired once. Confusingly if I change the $foo : Foo(bar == false) to $foo : Foo() then it is correctly fired for all Foo's. What am I missing?

Upvotes: 1

Views: 376

Answers (1)

Jim
Jim

Reputation: 22656

Bah. I'm an idiot. My cloneSolution method was calling a copy constructor which didn't correctly copy bar.

Upvotes: 1

Related Questions