RuleSet (RuleFlowGroup)
by rchemisa
Hello,
I'm trying tp understand how does the Rule Set works and I'm experiencing
some problems. I need it to stop
when the process finds a 'rule set' and it doesn't match with the
conditions, however, the process continues even the facts do not fulfill the
conditions.
Can someone explain me how does the 'rule set' works or can u give an
example?
thank you very much
--
View this message in context: http://drools.46999.n3.nabble.com/RuleSet-RuleFlowGroup-tp3165058p3165058...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Serializing knowledgepackages - execution behaviour
by FrankVhh
Hi all,
After playing with serializing knowledgepackages a bit, I stumbled upon some
behaviour which I cannot explain at the moment. I can only hope someone can
deliver a hint of insight into this.
The situation:
Creating and executing a rule engine with the very same rules. In the first
attempt, rules are serialized first. Note that only the rules are
serialized, not the engine.
In the second attempt, the "normal" (= "as in the hello world sample")
procedure is used to feed the rules to the engine.
I noticed some performance differences at execution time, which amaze me a
bit, as I can't see a reason why execution would differ...
When loading the serialized rules, rule execution is slightly slower and,
more important, there are some glitches in the performance (execution times
over 10 times slower than average execution). Unserialized rules run much
smoother and much more consistent.
Does anyone have any explanation for this? I am very interested to find out.
Thanks a lot.
Regards,
Frank
--
View this message in context: http://drools.46999.n3.nabble.com/Serializing-knowledgepackages-execution...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Re: [rules-users] Rule error
by FrankVhh
Hi,
It depends upon which version of drools you are using, but if it is a
version pre 5.2.0, than your last line should be:
eval($c.getDoMin()>=$m.getDoMin())
If you are using 5.2.0, the parser allow a bit more freedom, allthough I am
not sure about this very case. You surely will have to omit the ; at the end
of your condition.
Regards,
Frank
michou89 wrote:
>
> rule "ValidMechanism"
> when
> $c : Capacity(doMin>20)
> $m : Mechanism(DMOMax<=30, doMax>50 && doMin<40 && maxPower>180 &&
> minPower>=100 && bidPower>100 && <200)
> $c.getDoMin()>=$m.getDoMin();
> then
> System.out.println("Capacity n°"+$c.getIdCapacity()+" eligible to the
> mechanism n°"+$m.getIdMechanism()+" for rule 1" );
> end
>
>
> My error : org.drools.rule.InvalidRulePackage: [40,15]: unknown:40:15
> mismatched token: [@100,813:814='>=',<78>,40:15]; expecting type THEN
> (this is the last line before the "then")
>
>
> I don't understand why I can't compare 2 values.
>
--
View this message in context: http://drools.46999.n3.nabble.com/Rule-error-tp3162619p3165771.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
repository in 5.2.M2 crashes in 5.2.Final because of decision table serialization
by Vincent LEGENDRE
Hi all
We tried to use the 5.2.Final version of Guvnor, but the compilation fails with an error saying that class "dtable" does not exists.
After looking more depply, it appears that the XML storage format has changed in 5.2.Final :
- root XML is now " decision-table52 " instead of "dtable"
- pattern is now " org.drools.guvnor.client.modeldriven.dt52.Pattern52 " with some condition-column grouped by fact, instead of independant condition-column
- pattern is now " org.drools.guvnor.client.modeldriven.dt52.Pattern52 " with some condition-column grouped by fact, instead of independant condition-column
- actions is now " insert-fact-column 52" instead of the same thing without version in it, but this time no structure changes ...
Is there a way to migrate old tables to new format ?
Changing a repository.xml by subtitutions is OK ?
Do we have to plan such problems for future versions ?
14 years, 6 months
How to Access and Execute Rules from Database
by Ashish Soni
Hi All ,
I am able to configure oracle database in drools but now i am not able to
find how can i load rules from the DB and execute them , I gone through the
documentation but not able to get much information or might be i am missing
something.
If any one can provide me a example or some pointer ,hints then it would be
helpful.
Regards,
Ashish
14 years, 6 months
Drools and serialize
by clement.pernot
Hi,
I want to serialize a StatefulKnowledgeSession in drools (which have rule
and fact)
Actually i know how to serialize a KnowledgeBase.
Here is my code for serialize a KnowledgeBase:
KnowledgeBuilder kBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kBuilder.add( ResourceFactory.newFileResource( "Sample.drl" ),
ResourceType.DRL );
if( kBuilder.hasErrors() ){
for( KnowledgeBuilderError err: kBuilder.getErrors() ){
System.err.println( err.toString() );
}
throw new IllegalStateException( "DRL errors" );
}
KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
kBase.addKnowledgePackages( kBuilder.getKnowledgePackages() );
OutputStream os = new FileOutputStream( "droolsCompiledFile" );
ObjectOutputStream oos = new ObjectOutputStream( os );
oos.writeObject( kBase );
oos.close();
This work fine, no problem here.
Here is my code for serialize a StatefulKnowledgeSession:
KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kBuilder.add( ResourceFactory.newFileResource( "Sample.drl" ),
ResourceType.DRL );
if( kBuilder.hasErrors() ){
for( KnowledgeBuilderError err: kBuilder.getErrors() ){
System.err.println( err.toString() );
}
throw new IllegalStateException( "DRL errors" );
}
KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
kBase.addKnowledgePackages( kBuilder.getKnowledgePackages() );
try {
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
ksession.insert(message);
Marshaller marshaller = MarshallerFactory.newMarshaller(
ksession.getKnowledgeBase(), new ObjectMarshallingStrategy[]{
MarshallerFactory.newSerializeMarshallingStrategy() } );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectMarshallingStrategy oms =
MarshallerFactory.newIdentityMarshallingStrategy();
marshaller.marshall( baos, ksession );
ObjectOutputStream out = new ObjectOutputStream( baos );
out.writeObject( marshaller );
out.close();
baos.close();
ksession.fireAllRules();
} catch (Throwable t) {
t.printStackTrace();
}
}
But this didn't work.
I get always the same error:
"java.io.NotSerializableException"
I have try to not implement the "marshall" but this didn't work.
I don't know what I must do. Can someone help me?
Thank.
Best regards,
Clement Pernot
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-and-serialize-tp3161882p3161882....
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
BRMS on WebLogic
by Benson Fung
Hi,
Is there installation documentation how BRMS/Drools Guvnor is
installed on WebLogic server? Please help.
Thanks
Benson
14 years, 6 months