KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
((PackageBuilderConfiguration) conf).initSemanticModules();
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNSemanticModule());
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNDISemanticModule());
((PackageBuilderConfiguration) conf).addDialect("XPath", new XPathDialectConfiguration());
XmlProcessReader processReader = new XmlProcessReader(
((PackageBuilderConfiguration) conf).getSemanticModules());
RuleFlowProcess p = (RuleFlowProcess)
processReader.read(SimpleBPMNProcessTest.class.getResourceAsStream("/BPMN2-AdHocSubProcessAutoComplete.xml"));
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(conf);
// System.out.println(XmlBPMNProcessDumper.INSTANCE.dump(p));
kbuilder.add(ResourceFactory.newReaderResource(
new StringReader(XmlBPMNProcessDumper.INSTANCE.dump(p))), ResourceType.BPMN2);
kbuilder.add(ResourceFactory.newClassPathResource("BPMN2-AdHocSubProcess.drl"), ResourceType.DRL);