use of org.drools.compiler.compiler.PackageBuilderErrors in project drools by kiegroup.
the class KieBaseUpdater method rebuildAll.
private void rebuildAll(KnowledgeBuilderImpl kbuilder, CompositeKnowledgeBuilder ckbuilder) {
ckbuilder.build();
PackageBuilderErrors errors = kbuilder.getErrors();
if (!errors.isEmpty()) {
for (KnowledgeBuilderError error : errors.getErrors()) {
ctx.results.addMessage(error).setKieBaseName(ctx.newKieBaseModel.getName());
}
log.error("Unable to update KieBase: " + ctx.newKieBaseModel.getName() + " to release " + ctx.newReleaseId + "\n" + errors.toString());
}
if (ctx.modifyingUsedClass) {
kbuilder.rewireAllClassObjectTypes();
}
}
use of org.drools.compiler.compiler.PackageBuilderErrors in project jbpm by kiegroup.
the class ProcessExceptionHandlerTest method testFaultWithoutHandler.
@Test
public void testFaultWithoutHandler() {
Reader source = new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" + " xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" + " type=\"RuleFlow\" name=\"flow\" id=\"org.drools.exception\" package-name=\"org.drools\" version=\"1\" >\n" + "\n" + " <header>\n" + " </header>\n" + "\n" + " <nodes>\n" + " <start id=\"1\" name=\"Start\" />\n" + " <fault id=\"2\" name=\"Fault\" faultName=\"myFault\" />\n" + " </nodes>\n" + "\n" + " <connections>\n" + " <connection from=\"1\" to=\"2\" />\n" + " </connections>\n" + "\n" + "</process>");
builder.addRuleFlow(source);
PackageBuilderErrors errors = builder.getErrors();
if (errors != null && !errors.isEmpty()) {
for (DroolsError error : errors.getErrors()) {
logger.error(error.toString());
}
fail("Package could not be compiled");
}
KieSession session = createKieSession(builder.getPackages());
ProcessInstance processInstance = (ProcessInstance) session.startProcess("org.drools.exception");
assertEquals(ProcessInstance.STATE_ABORTED, processInstance.getState());
}
use of org.drools.compiler.compiler.PackageBuilderErrors in project drools by kiegroup.
the class KieBaseUpdaterImpl method rebuildAll.
private void rebuildAll(InternalKnowledgeBuilder kbuilder, CompositeKnowledgeBuilder ckbuilder) {
ckbuilder.build();
PackageBuilderErrors errors = (PackageBuilderErrors) kbuilder.getErrors();
if (!errors.isEmpty()) {
for (KnowledgeBuilderError error : errors.getErrors()) {
ctx.results.addMessage(error).setKieBaseName(ctx.newKieBaseModel.getName());
}
log.error("Unable to update KieBase: " + ctx.newKieBaseModel.getName() + " to release " + ctx.newReleaseId + "\n" + errors.toString());
}
if (ctx.modifyingUsedClass) {
kbuilder.rewireAllClassObjectTypes();
}
}
Aggregations