How to set streaming mode
by GrantWang
I have the following that is working.
KieServices kieServices = KieServices.Factory.get();
ReleaseId releaseId = kieServices.newReleaseId("com.company",
"drools", "0.0.1-SNAPSHOT");
KieFileSystem kfs = kieServices.newKieFileSystem();
kfs.generateAndWritePomXML(releaseId);
addRules(kieServices, kfs);
KieContainer kieContainer = kieServices.newKieContainer(releaseId);
final KieSession kieSession = kieContainer.newKieSession();
Then I want to change to STREAM mode, so I tried to create the session using
KieBase, but none of my rules runs using this method (doesn't matter if
STREAM or not). I am new to drools, would someone please let me know what is
wrong in my code? (full file also attached)
// KieBaseConfiguration kieBaseConf =
kieServices.newKieBaseConfiguration();
// //kieBaseConf.setOption( EventProcessingOption.STREAM );
// KieBase kieBase = kieContainer.newKieBase(kieBaseConf);
// final KieSession kieSession = kieBase.newKieSession();
Old output with session from container:
---- no rule ----
---- hot-deploy-0.drl ----
DRL started: insertion A inserted
mod1 A -> B
mod2 B -> A
mod1 A -> B
---- hot-deploy-1.drl ----
mod2 B -> A
mod1 A -> B
New file loaded
new mod2 B -> C
---- I am done ----
New output with session from kieBase:
---- no rule ----
---- hot-deploy-0.drl ----
---- hot-deploy-1.drl ----
---- I am done ----
Thanks! Playground4.java
<http://drools.46999.n3.nabble.com/file/n4028692/Playground4.java>
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-set-streaming-mode-tp4028692.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
compare date structure in WHEN part
by Gopu Shrestha
I want to compare the date structure YYYY-MM-DD in when part. Can I do this?? any help will be appreciated..
rule "name"
when
DateRange($endDate: endDate !=null) // $endDate ==" YYYY-MM-DD" structure
then
log.info("..........")
end
11 years, 10 months
6.0.1.F Enumeration Reloading Weirdness
by SrjTx
I have an enum along the lines of
Bean.x : (new com.xyz.MyClass()).getNames()
Which works fine and getNames() is called when JBoss first starts up and the
first time that a rule using this enum is created.
But, getNames() is never called again. Either when a new rule is created or
if you do the close/reopen the editor thing. Which means that the enum gets
out of date with the DB it is pulling from.
I did find a work-around, if you also edit the .enumeration file, I just add
a blank entry at the bottom of table - then getNames() is called with a new
rule is created of you do the close/reopen the editor thing.
Is there a fix in head for this?
--
View this message in context: http://drools.46999.n3.nabble.com/6-0-1-F-Enumeration-Reloading-Weirdness...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Hot deploy rules
by GrantWang
I am trying to figuring out how to hot deploy .drl files. Right now, I can do
the job by using releaseID to get a KieContainer. Then later on after I add
a new rule file, I can call kieContainer.updateToVersion.
But is there a way to get the container from classpath
(getKieClasspathContainer) first, and set releaseId, so later on I can use
updateToVersion? I want to use my existing setup in kmodule.xml, and
hopefully load all pre-existing .drl files from classpath at startup time.
Thanks!
Grant
--
View this message in context: http://drools.46999.n3.nabble.com/Hot-deploy-rules-tp4028671.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Guvnor Building packages - Built-in selector - Status
by Jens
Hello everybody,
We are using Guvnor 5.3.0 Final.
So far we have built our rules packages without any built-in selector or
custom selector at all. It might be requested by business to only deploy a
subset of our rules inside a specific package.
We are thinking in using built-in selector by Rules Status. However, Guvnor
does not validate any Status selector entered by the user against Rule
Status created through Administration module. If the user makes a mistake
and enters an invalid Rule Status in the selector, there is no error or
warning provided, and what happens is that nothing is packaged and all rules
are cleared out from our working memory in our app.
Is there any way for Guvnor to validate that only valid Rule Statuses are
entered in the built-in selector Status textbox?
Thanks
Jens
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Building-packages-Built-in-selec...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Fwd: Not able to deploy workbench
by Michael Anstis
---------- Forwarded message ----------
From: Maciej Swiderski <swiderski.maciej(a)gmail.com>
Date: 12 March 2014 13:07
Subject: Re: [rules-users] Not able to deploy workbench
To: Michael Anstis <michael.anstis(a)gmail.com>
Cc: Toni Rikkola <toni(a)rikkola.net>
Mike,
comments inline.
Maciej
On 12 mar 2014, at 13:16, Michael Anstis <michael.anstis(a)gmail.com> wrote:
Any ideas?
(With your tomcat experience)
Sent on the move
---------- Forwarded message ----------
From: "stephan" <stephan(a)sann.name>
Date: 12 Mar 2014 12:04
Subject: Re: [rules-users] Not able to deploy workbench
To: <rules-users(a)lists.jboss.org>
Cc:
Thanks, manstis!
The information and the link you provided were very helpful.
I am now able to deploy the application on tomcat and get to the login-page.
Nevertheless I am not able to log in :(
I followed every step provided in the "README.txt", except step 5. ("Edit
web.xml and uncomment all entries that are marked with TOMCAT-JEE-SECURITY")
- because it was not possible.
a) It doesn't say which "web.xml" - could be the one included in the WAR,
could be the one included in Tomcat's "conf"-directory.
web.xml from war file should be edited
b) Neither of these two files has entries marked "TOMCAT-JEE-SECURITY" (I
have Tomcat 7.0.47).
these files are again in war inside WEB-INF
Maciej
c) Google-search for "TOMCAT-JEE-SECURITY" brings up 7 (!) results - none of
them helpful (most of them just repeating the same sentence from the
readme-file...)
Any more ideas?
Thanks again!
Best regards
Stephan
--
View this message in context:
http://drools.46999.n3.nabble.com/Not-able-to-deploy-workbench-tp4028658p...
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
11 years, 10 months
Drools pipeline API
by GrantWang
Hi, I am new to Drools and have couple of questions:
1. I found the following in document:
"The Drools pipeline API has several adapters and helpers to do that as well
as examples on how to do it."
Could someone please send me a link to this Drools pipeline API. I did a
search but couldn't find it.
2. I am looking to a way to load a DRL on the fly. All the examples I found
online is from 5.X:
File drl1 = new File("src/main/resources/rules/DroolsTest.drl");
Resource resource1 = ResourceFactory.newInputStreamResource(new
FileInputStream(drl1));
KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
builder.add(resource1, ResourceType.DRL);
KnowledgeBase kb = builder.newKnowledgeBase();
kSession = kb.newStatefulKnowledgeSession();
kSession.fireUntilHalt();
It works, but looks like the type KnowledgeBase is deprecated in 6.0. And I
couldn't find it in Kie API java doc. How can I do the same in 6.0? Also is
there a way I can monitor a directory? So that new rule files can be loaded
automatically after add into this directory (suppose I don't need to do
anything in my App since I used fireUntilHalt.)
Thanks a lot.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-pipeline-API-tp4028616.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months