Created
March 31, 2011 21:20
-
-
Save tsurdilo/897286 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sample | |
import com.sample.Person; | |
import com.sample.PersonManager; | |
import com.sample.ControlFact; | |
import java.util.List; | |
global PersonManager manager; | |
rule "Say hello to Atlantians" extends "control rule" | |
dialect "mvel" | |
ruleflow-group "evaluate-people" | |
when | |
$atlantians : List() | |
from collect( Person( city == "Atlanta" ) | |
from manager.getAllPeople() | |
) | |
then | |
System.out.println("[saying hello to all atlantians]"); | |
end | |
rule "control rule" | |
dialect "mvel" | |
enabled false | |
ruleflow-group "evaluate-people" | |
when | |
ControlFact() | |
then | |
end | |
******************************** | |
[** querying all people - this is a heavy db operation **] | |
--> Entering subflow <-- | |
Event Listener adding a control fact ... | |
[saying hello to all atlantians] | |
--> Exiting subflow <-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment