KieBaseConfiguration baseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
baseConfig.setOption(EventProcessingOption.STREAM);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( baseConfig );
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
KieSessionConfiguration sessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
sessionConfig.setOption( ClockTypeOption.get( ClockType.PSEUDO_CLOCK.getId() ) );
//init stateful knowledge session
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession( sessionConfig, null );
SessionPseudoClock clock = (SessionPseudoClock) ksession.<SessionClock>getSessionClock();