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

Wolfgang Laun wolfgang.laun at gmail.com
Fri Mar 9 01:49:59 EST 2012


See the 5.3.0 Expert manual, Section 4.2.4., Building and Deployment
in Separate Processes.

-W


On 08/03/2012, womuji <cmregister at gmail.com> wrote:
> 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.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list