Last active
February 22, 2016 22:15
This file contains hidden or 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
// Init a new stateful session | |
KieSession kSession = kieContainer.newKieSession(); | |
// Insert a placeholder for operations and statistics | |
TradingSession session = new TradingSession(); | |
kSession.insert(session); | |
// We add an empty indicator to our stocks | |
quotations.forEach(quot -> quot.getIndicators().put("SCORE", new ScoreIndicator())); | |
// Submit each quotation and fire | |
for (AnalizedStockQuotation quot : quotations){ | |
kSession.insert(quot); | |
kSession.fireAllRules(); | |
} | |
// Recover results and clean up the memory | |
List<Operation> toReturn = session.getOperationList(); | |
kSession.dispose(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment