[rules-users] adding process to an empty rule base

hypnosat7 ablarbi at yahoo.fr
Fri Jul 27 11:30:43 EDT 2007



I try this:
...
	InputStream stream =
getClass().getResourceAsStream("/rules/demoRuleFlow.rfm");
		Reader ruleFlowReader = new InputStreamReader(stream);
		ruleEngine.setRuleFlow(ruleFlowReader);
..

				PackageBuilder builder = new PackageBuilder();
				builder.addRuleFlow(ruleFlow);
				Package pkgRuleFlow = builder.getPackage();
				ruleBase.addPackage(pkgRuleFlow);

but I have this error:
Caused by: java.lang.NoSuchMethodError:
org.mvel.optimizers.OptimizerFactory.setDefaultOptimizer(Ljava/lang/String;)V
	at
org.drools.rule.builder.dialect.mvel.MVELDialect.init(MVELDialect.java:132)
	at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
	at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:139)
	at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:88)



Kris Verlaenen wrote:
> 
> Yes, that is possible, but you should also add the (generated) package of 
> your PackageBuilder.
> 
> But this process is actually much simpler when using the ProcessBuilder 
> exclusively.
> It should look something like this:
> 
> PackageBuilder builder = new PackageBuilder();
> // add your rules (if any)
> builder.addPackageFromDrl( ... );
> // add your processes (if any)
> builder.addRuleFlow( ... );
> // add Package to ruleBase
> Package pkg = builder.getPackage(); // this includes all the rules and 
> processes
> ruleBase.addPackage( pkg );
> 
> Kris
> 
> ----- Original Message ----- 
> From: "hypnosat7" <ablarbi at yahoo.fr>
> To: <rules-users at lists.jboss.org>
> Sent: Friday, July 27, 2007 3:59 PM
> Subject: [rules-users] adding process to an empty rule base
> 
> 
>>
>> Is it possible to set the rule flow in my rule base before adding rule
>> packages :
>>
>> ruleBase = RuleBaseFactory.newRuleBase();
>> org.drools.compiler.ProcessBuilder processBuilder = new
>> ProcessBuilder(new
>> PackageBuilder());
>> processBuilder.addProcessFromFile(ruleFlow);
>> ruleBase.addProcess(processBuilder.getProcesses()[0]);
>>
>> thanks
>> -- 
>> View this message in context: 
>> http://www.nabble.com/adding-process-to-an-empty-rule-base-tf4157978.html#a11829714
>> Sent from the drools - user mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users 
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://www.nabble.com/adding-process-to-an-empty-rule-base-tf4157978.html#a11831502
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list