return context.getRepository();
}
protected static ReleaseId createKJarWithMultipleResources(String id, String[] resources, ResourceType[] types) {
KieServices ks = KieServices.Factory.get();
KieModuleModel kproj = ks.newKieModuleModel();
KieFileSystem kfs = ks.newKieFileSystem();
for (int i = 0; i < resources.length; i++) {
String res = resources[i];
String type = types[i].getDefaultExtension();
kfs.write("src/main/resources/" + id.replaceAll("\\.", "/")
+ "/org/test/res" + i + "." + type, res);
}
KieBaseModel kBase1 = kproj.newKieBaseModel(id)
.setEqualsBehavior(EqualityBehaviorOption.EQUALITY)
.setEventProcessingMode(EventProcessingOption.STREAM);
KieSessionModel ksession1 = kBase1
.newKieSessionModel(id + ".KSession1")
.setType(KieSessionModel.KieSessionType.STATEFUL)
.setClockType(ClockTypeOption.get("pseudo"));
kfs.writeKModuleXML(kproj.toXML());
KieBuilder kieBuilder = ks.newKieBuilder(kfs).buildAll();
if(!kieBuilder.getResults().getMessages().isEmpty()) {
for (Message msg : kieBuilder.getResults().getMessages()) {
System.out.println("[ERROR]" + msg.getText());