Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Service
public class BusPassService {
private final KieContainer kieContainer;
@Autowired
public BusPassService(KieContainer kieContainer) {
log.info("Initialising a new bus pass session.");
this.kieContainer = kieContainer;
}
/**
* Create a new session, insert a person's details and fire rules to
* determine what kind of bus pass is to be issued.
*/
public BusPass getBusPass(Person person) {
KieSession kieSession = kieContainer.newKieSession("BusPassSession");
kieSession.insert(person);
kieSession.fireAllRules();
BusPass busPass = findBusPass(kieSession);
kieSession.dispose();
return busPass;
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.