Skip to content

Instantly share code, notes, and snippets.

@tsurdilo
Created March 31, 2011 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsurdilo/897283 to your computer and use it in GitHub Desktop.
Save tsurdilo/897283 to your computer and use it in GitHub Desktop.
package com.sample
import com.sample.Person;
import com.sample.PersonManager;
import com.sample.ControlFact;
import java.util.List;
global PersonManager manager;
rule "control rule"
dialect "mvel"
enabled false
ruleflow-group "evaluate-people"
when
ControlFact()
then
end
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
*********************
--> Entering subflow <--
Event Listener adding a control fact ...
[** querying all people - this is a heavy db operation **]
[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