Hi,
I was just going through how to work with knowledge builder and have some doubts:
Code sample is as follows:
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
// this will parse and compile in one step
kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl",
HelloWorldExample.class), ResourceType.DRL);
// Check the builder for errors
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors().toString());
throw new RuntimeException("Unable to compile
\"HelloWorld.drl\".");
}
// get the compiled packages (which are serializable)
final Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();
// add the packages to a knowledgebase (deploy the knowledge packages).
final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
In the above code: I am manually having to add the .drl file and the classpath to my
kbuilder. So don't I just have to end up listing all the files and adding it to my
knowledge builder?
Is it that each of the files keeps getting added as and when you update the rule files?
How does the program detect this update?? As I am ending up having to add everything.
Please guide.
Thank you
M
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of rules-users-request(a)lists.jboss.org
Sent: Tuesday, June 15, 2010 12:00 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 75
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Uploading rules dynamically (Esteban Aliverti)
2. Re: Dynamic rule file uploading (Fnu Mahalakshmi)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Jun 2010 12:12:45 -0300
From: Esteban Aliverti <esteban.aliverti(a)gmail.com>
Subject: Re: [rules-users] Uploading rules dynamically
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<AANLkTilRCzG0E9-W6OsVWXHy_kyQNpDdblxitfmg91YZ(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
You can read about Knowledge Agent:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr...
Maybe it suits your needs.
2010/6/15 Fnu Mahalakshmi <FMahalakshmi(a)nyx.com>
Hi Guys,
How can I dynamically upload my rules? Can someone point me towards some
documentation for the same??
Thank you.
M
------------------------------
*Please consider the environment before printing this email.*
*Visit our website at
http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is
privileged, confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by replying to
the message, and please delete it from your system. Thank you. NYSE
Euronext. *
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti