[rules-users] load precompiled rule/ruleflow file in 5.3.0

womuji cmregister at gmail.com
Thu Mar 8 14:27:44 EST 2012


We are upgrading from Drools 5.1 to 5.3.0.Final, and running into issues with
loading precompiled rule/ruleflow files.

Previously, we precompiled our drl files using ant task
"org.drools.contrib.DroolsCompilerAntTask", e.g. rule1.drl to
rule1.drl.rules. We did the similar thing for ruleflow files, i.e.
precompiled all of our rf files to a single ruleflow.flow file. In our java
code, in 5.1, we load them as following:

               DroolsObjectInputStream ruleFlowStream = null;
		try
		{
			ruleFlowStream = new DroolsObjectInputStream(
				new BufferedInputStream(
					resourceLoader.getResource(
						"classpath:ruleflow.flow"
					).getInputStream()
				)
			);
			org.drools.rule.Package ruleFlow =
(org.drools.rule.Package)ruleFlowStream.readObject();
			ruleBase.addPackage(ruleFlow);
		}
                ...

Same thing for the rule files.

My question is:
How do we load the precompiled file in 5.3 (we switch to the KnowledgeBase
API ) so that we can save the compiling time when loading?

Thanks.

--
View this message in context: http://drools.46999.n3.nabble.com/load-precompiled-rule-ruleflow-file-in-5-3-0-tp3810622p3810622.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list