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(a)yahoo.fr>
To: <rules-users(a)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...
> Sent from the drools - user mailing list archive at
Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)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...
Sent from the drools - user mailing list archive at
Nabble.com.