Listing all packages present in gunvor repository
by srinivasasanda
Hi,
*Listing Packages*
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder1.getKnowledgePackages());
kbase.addKnowledgePackages(kbuilder2.getKnowledgePackages());
int flag=1;
for(KnowledgePackage kp :kbase.getKnowledgePackages())
{
System.out.println("Package Names are"+kp.getName());
}
The code which i had written here can possible to retrieves the
list of packages.Here,I added snapshots to kbuilder1,kbuilder2 and through
kbase iam retrieving the packages list.Is it is possible to retrieve list of
packages without adding package snapshots to kbuilder.???It means i think
through repository.xml...How can i achieve that???
Even i referred REST API but unable to retrieve XML nodes from it
--
View this message in context: http://drools.46999.n3.nabble.com/Listing-all-packages-present-in-gunvor-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
Opportunistic Backward Chaining
by Maciej Gowin
I saw that there is an open issue for Opportunistic Backward Chaining:
https://issues.jboss.org/browse/JBRULES-3272
While I want to start working on this topic during my PhD thesis
my question is if there is any work done on this?
Is there any possibility to contribute in solving this issue?
Of course I know that there is already Prolog Style Query Based
Backward Chaining implemented.
14 years, 7 months
Can I put java code in dslr file?
by Zhao Yi
I want to convert my drl to dsl and dslr. I found that if I choose using dsl,
I couldn't write java code in rules any more. I must translate everything in
dsl file. Can I combine dsl and drl in dslr file, like below rule. when I am
using dsl, I will get an error: "[10] Unable to expand:
System.out.println("add caculation start");"
rule "add caculation"
agenda-group "add"
no-loop true
dialect "java"
lock-on-active
when
$m: Whether exist event
then
System.out.println("add caculation start");
System.out.println("add caculation end");
end
--
View this message in context: http://drools.46999.n3.nabble.com/Can-I-put-java-code-in-dslr-file-tp3578...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
Dependency Enumeration List in Drools
by srinivasasanda
The concept was..
I have one Model with fact named *Person*---with *country,state* as fields..
I need to create enumeration for country and state which should be load
dynamically.
Here is my enumeration code
'Person.country' : (new com.sample.DataList()).getMycountriesList()
Now,Its working fine..The countries list was succesfully loading in rule
diplaying as drop-down list.But If i select *US* in one of the
list-box,*states* must be displayed dynamically.
'Address.state[country=USA]' : (new com.sample.DataList()).getMyUSList().
But,If i have 100 countries It is not good way to write 100 times this code
specifying country=....
'Address.state[country=UK]' : (new com.sample.DataList()).getMyUKList()
'Address.state[country=Australia]' : (new
com.sample.DataList()).getMyAustraliaList()
........
......
.......etc
How can I achieve dynamically..When I click USA in drop-down box.State list
must be displayed.How can I achieve this..Please suggest me
--
View this message in context: http://drools.46999.n3.nabble.com/Dependency-Enumeration-List-in-Drools-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
Managing memory
by Laird Nelson
Hello; this is probably a pretty basic kind of question, but I want to see
what other users' tricks are for managing memory in their sessions.
My application is a straightforward survey-type application. There are
questions, choices, answers (choice selections) and so on. Once someone
has selected an answer, the rule evaluation kicks in. The determination of
which question to show next is made based on...well, pretty much anything.
Typically it's on the current user's last answer to a question, but it
might also involve his answers to several previous questions in his own
path through the survey.
This being psychology-related, there are hundreds of questions and probably
hundreds of rules. "If the question the user just answered is question 4,
and if the user selected 'sometimes' as the answer to question 4, and if he
also selected 'never' as the answer to question 1 during this interview
session, and he is over 40, then show him question 25 next" is a good
example of one such rule. You can see how there might be nearly one rule
for each question.
(The rulebase session itself could probably be sequential--none of the
facts in the session is modified in such a way that reevaluation of the
rulebase is necessary.)
OK, so, currently I load pretty much everything into the (stateful)
knowledge session I have. That means--what with all the question text and
answer text and everything--there is a LOT of data in this particular
session. Multiply times the number of concurrent interviews being
administered and this thing chews through heap in a hurry.
One approach I thought of was to simply load the current question into the
session as a fact and then rely on various accumulate functions to load
other questions and answers as necessary. But this approach isn't much
better than a linear series of if/then statements, if I understand
correctly.
What are some of the so-called best practices here? Are there particular
Drools-centric development approaches I should be taking, or architectural
choices I should be making? Or is this just a case of throw hardware at
the problem? :-)
Again, I'm not so much looking for A Single Right Answer as I am reports
from the field. You may feel free to contact me directly if you wish.
Best,
Laird
--
http://about.me/lairdnelson
14 years, 7 months