0

Whenever i write duration(0s), it works but as soon as i change it to duration(1s) or duration(5s), the rule doesn't fire... This is the rule which i want to fire.

rule "ContainsChecking"

agenda-group "town4"

duration(0s)

when

Town(owner matches "[N || n][a-z]+")

then

System.out.println("Rule Fired ContainsChecking");

end

do we need to import something for duration attribute to work, because i m not getting it anywhere. Thanks in advance.

gionni
  • 1,284
  • 1
  • 12
  • 32
John
  • 3
  • 1

1 Answers1

0

You need to run the session using

kieSession.fireUntilHalt();

If you just use fireAllRules, the agenda is empty and the call terminates.

This is a CEP feature and need not and should not be used in a simple production rule environment.

laune
  • 31,114
  • 3
  • 29
  • 42
  • as i am adding this kieSession.fireUntilHalt(); into @test case.. it is throwing error that kiesession cannot be resolved. So what should i do. Thanks. – John Sep 18 '17 at 08:02
  • Use the identifier for the object reference with which you have called fireAllRules. (How am I to know such details of your program?) – laune Sep 18 '17 at 13:32