public class App {
@Inject
@KSession
private KieSession kSession;
public void bootstrapDrools() {
// The KieSession was injected so we can use it now
kSession.insert("Hi There!");
int rulesFired = kSession.fireAllRules();
System.out.println(">>> Rules Fired: "+rulesFired);
}
public static void main(String[] args) {
//Boostrap the CDI container, in this case WELD
Weld w = new Weld();
WeldContainer wc = w.initialize();
App app = wc.select(App.class).get();
app.bootstrapDrools();
w.shutdown();
}
}