In the latest source available in github the KnowledgeBuilder interface have a method undo
{https://github.com/droolsjbpm/droolsjbpm-knowledge/blob/master/knowledge-api/src/main/java/org/drools/builder/KnowledgeBuilder.java}
So that it looks like I can implement my use case as below
kbuilder.add(ResourceFactory.newByteArrayResource(processFile), ResourceType.BPMN2);
if(kbuilder.hasErrors()){
/**
*/
kbuilder.undo();
}
But unfortunately I think the version included with JBPM5.2 doesn't have this method ( knowledge-api-5.3.1.Final.jar ) .
In my work environment I am not allowed to work with an unreleased (latest) version :(( .Does anyone know a workaround.
Cheers :)