public KieModuleModel createKieModule(String namespace,
boolean createJar,
String version) throws IOException,
ClassNotFoundException,
InterruptedException {
KieModuleModel kproj = new KieModuleModelImpl();
KieBaseModel kieBaseModel1 = kproj.newKieBaseModel(namespace + ".KBase1")
.setEqualsBehavior( EqualityBehaviorOption.EQUALITY )
.setEventProcessingMode( EventProcessingOption.STREAM )
.setDefault( true );
KieSessionModel ksession1 = kieBaseModel1.newKieSessionModel(namespace + ".KSession1")
.setType( KieSessionType.STATELESS )
.setClockType( ClockTypeOption.get("realtime") )
.setDefault( true );
KieSessionModel ksession2 = kieBaseModel1.newKieSessionModel(namespace + ".KSession2")
.setType( KieSessionType.STATEFUL )
.setClockType( ClockTypeOption.get( "pseudo" ) )
.setDefault( true );
KieBaseModel kieBaseModel2 = kproj.newKieBaseModel(namespace + ".KBase2")
.setEqualsBehavior( EqualityBehaviorOption.IDENTITY )
.setEventProcessingMode( EventProcessingOption.CLOUD );
KieSessionModel ksession3 = kieBaseModel2.newKieSessionModel(namespace + ".KSession3")
.setType( KieSessionType.STATEFUL )
.setClockType( ClockTypeOption.get( "pseudo" ) );
KieBaseModel kieBaseModel3 = kproj.newKieBaseModel(namespace + ".KBase3")
.addInclude( kieBaseModel1.getName() )
.addInclude( kieBaseModel2.getName() )
.setEqualsBehavior( EqualityBehaviorOption.IDENTITY )
.setEventProcessingMode( EventProcessingOption.CLOUD );