Knowledge base cache
by Raja Sekhar
Hi,
During processing a 100 thousand facts read from a database. We are
measuring performance by using java's time.Some times i see a sudden rise
in the times.
It is a good solution to cache the knowledgebase.I am using
the StatefulKnowledgeSession.
Regards,
Raja Sekhar Amirapu
------------------------------------------------------
12 years
Drools 6.x and Maven
by mattmadhavan
Hello,
I am having a hard time building any Drools 6.x examples! Maven just would
not resolve any Drools 6.x dependencies. For example I am getting the
following error when I tried to build a sample
Are the Drools 6.x artifacts present in the Maven public repo? DO I need ton
add any Drools specific repository in my repositories path?
Please note that I have no problem with Maven and Drools 5.5.0
Thanks in advance!
Matt'M
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-x-and-Maven-tp4028312.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Nested negation constraints behavior change from Drools 5.x to 6.x
by mikerod
With both Drools v5.5.0.Final and v5.6.0.Final I observe a different behavior
than in both v6.0.0.Final and v6.0.1.Final.
in certain rules with negation wrapped around nested constraints.
I have tried to make the simplest rules to demonstrate the situation.
With a kb consisting of the following rules, which I have comments on that
describe what I've
found with the situation:
```
// Enabling this rule, makes "negation_over_nested" and
// "negation_distributed_partially_sharing" fire;
// without it they do not.
//
// I think this is due to some shared structure
// in the underlying subnetwork (I believe this is referred to as a
"segment").
// Perhaps it makes them "linked" in when otherwise they are being missed.
/** *This is commented out, uncommenting causes different firing of other
rules*
rule shared_conjunct
when
(not (String() and Integer()))
then
System.out.println("shared_conjunct");
end
*/
// Won't fire with no wm facts UNLESS
// it shares (I think) a node/subnetwork/segment with constraints
// in a rule like "rule shared_conjunct" that DOES fire
rule negation_over_nested
when
not ( (String() and Integer())
or
(String() and Integer()))
then
System.out.println("negation_over_nested");
end
// Won't fire with no wm facts
rule negation_distributed_partially_no_sharing
when
(not (String() and Long()))
and
(not (String() and Long()))
then
System.out.println("negation_distributed_partially_no_sharing");
end
// Same situation as "negation_over_nested"
rule negation_distributed_partially_sharing
when
(not (String() and Integer()))
and
(not (String() and Integer()))
then
System.out.println("negation_distributed_partially_sharing");
end
// DOES fire with no wm inserts.
// DOES NOT need "shared_conjunct" to work
rule negation_distributed_fully
when
((not String()) or (not Integer()))
and
((not String()) or (not Integer()))
then
System.out.println("negation_distributed_fully");
end
```
---
This is the only 2 rules in the kb. Running a session, with no facts
inserted and then firing all rules.
---
Drools v5.x output
with "shared_conjuct" rule uncommented:
```
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
negation_distributed_partially_no_sharing
negation_distributed_partially_sharing
negation_over_nested
shared_conjunct
fired: 8
time elapsed: 0.0
done
```
with "shared_conjuct" rule commented out:
```
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
negation_distributed_partially_no_sharing
negation_distributed_partially_sharing
negation_over_nested
fired: 7
time elapsed: 0.0010
done
```
---
Drools v6.x output:
with "shared_conjuct" rule uncommented:
```
shared_conjunct
negation_over_nested
negation_distributed_partially_sharing
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
fired: 7
time elapsed: 0.0
done
```
with "shared_conjuct" rule commented out:
```
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
negation_distributed_fully
fired: 4
time elapsed: 0.0
done
```
I do note in the v6.x output, "negation_distributed_partially_no_sharing"
never fires, since it is specifically not sharing any
negated conjunt with the other rules. This seems to correlate with whether
or not these rules fire.
Also, I realize my terminology is slightly off. I think this is an issue
with rules having shared "segments", where
one of these segments that is shared is the negation subnetwork introduced
in "shared_conjunct".
I also note that "negation_distributed_fully" always fires, independent of
any potential "segment" sharing.
As I mentioned in a comment on "shared_conjuct", I'm thinking this relates
to the newer PHREAK algorithm vs the original ReteOO.
Is this expected? Is there something incorrect about the structure of the
negation rules?
Perhaps I have stumbled upon a defect?
I have not had time to do any sort of deeper debugging into the issue, if I
find out more info, I'll post it up here.
p.s. I know the types are not meaningful, this is just an example to show
the difference. I hope it accomplishes this goal.
--
View this message in context: http://drools.46999.n3.nabble.com/Nested-negation-constraints-behavior-ch...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Drools 6.0.1 with Spring - Custom Operator - Spring configuration for custom operators
by mattmadhavan
Hello,
I have defined a Drools custom operator which works great in Drools 5.4.0
and I am able to configure it to configure itvia spring Spring as follows.
<bean id=<b>"inListED"
class="org.facs.ncdb.drools.utils.InListEvaluatorDefinition" */>
<drools:kbase id="breastMeasureKBase">
<drools:resources>
<drools:resource type="DRL"
source="classpath:rules/mastrt_sequential_test.drl"/>
</drools:resources>
<*drools:configuration>
<drools:evaluators>
<drools:evaluator name="inlist" ref="inListED" />
</drools:evaluators>
</drools:configuration>*
</drools:kbase>
I am trying to do the same in Drools 6.x! How do I accomplish this? I cannot
find any documentation.
<bean id="inListED"
class="org.facs.ncdb.drools.utils.InListEvaluatorDefinition" />
<kie:kmodule id="measure">
<kie:kbase name="MASTRT" packages="MASTRT">
<kie:ksession name="breastMeasureKSession" type="stateless">
<kie:configuration>
* <drools:evaluators>
<drools:evaluator name="inlist" ref="inListED" />
</drools:evaluators>
* </kie:configuration>
</kie:ksession>/>
</drools:kbase>
</kie:kmodule>
I need to replace the *<drools:evaluator> *tag for drools 6.x?
Any ideas how to configure Drools Custom operator using Spring?
I appreciate in advance!
Thanks
Matt'M
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-0-1-with-Spring-Custom-Operato...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
@key declarations for a type - What's under the hood?
by profversaggi
Is there any way to interrogate exactly, as in get a printed representation
of what goes on under the hood for one of these type of declarations ?
As an example: (as per the docs) for a declared type like the following:
declare Person
*firstName : String @key*
*lastName : String @key*
age : int
end
The compiler will implicitly generate 3 constructors: one without
parameters,
one with the @key fields, and one with all fields.
Person() // parameterless constructor
Person( String firstName, String lastName )
Person( String firstName, String lastName, int age )
...creating an instance using the @key constructor
/Person person = new Person( "John", "Doe" );/
****************
So lets say I do the following:
declare Here
location: String @key
end
I understand that it does the above, but it *also* lets me do this as well:
* Here here = new Here("kitchen");
System.out.println( here );
System.out.println( here.getLocation(); );
$lh : Here (location == "kitchen")
System.out.println( "You are in the " + $lh.getLocation() );*
And get ...
*Here( location=kitchen )
kitchen
You are in the kitchen*
... from various rules I've created ... so there is a lot going on under the
hood, I just want to get a complete inventory of what that is and how I
inspect it for more complex type declarations.
Any ideas?
-matt
--
View this message in context: http://drools.46999.n3.nabble.com/key-declarations-for-a-type-What-s-unde...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
StatefulKnowledgeSession
by Raja Sekhar
Hi,
How do cache the StatefulKnowledgeSession, instead of creating a new
session every time.
Using storm for data extraction and calling the rules to process them
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
12 years
bench marking results for drools
by Raja Sekhar
Hi All,
For benchmark of drools rules.Any strategies are available?
I want to test my rules with 10,000 facts to 20,000,000 facts?
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
12 years
master - [BZ-1069337] fix incremental compilation when multiple KieContainers use the same ReleaseId
by SrjTx
I stumbled on this commit today hoping it would fix the behaviour we have
been chasing for quite some time to no avail.
In our setup we have tow containers pointing to the same releaseID via
LATEST. The version is static at 1.0 using KIE. We have two drl rules. One
rule contains logic will fire from container1 and the other from container 2
- they use two independent entry-points and objects unique to the respective
entry-point.
The test is simple, we send objects into both entry-points that should fire
both rules - they do. We make changes to the rules via KIE wb, deploy the
project, the containers pickup the changes however at runtime only changes
to rule 1 seem to b "loaded". More specifically container 1 pickups up the
new deltas while container 2 never does.
We are running inside a JBoss container env. The workaround is to restart
jboss and then the latest are used. I have verified that the jar that is
produced in .m2 is correct. I even saw the changes in the kbase.cache file
inside our jar.
Any ideas? Is LATEST not handled even with the above fix?
Are we experiencing https://issues.jboss.org/browse/SWITCHYARD-1840???
Thanks
-J
-
--
View this message in context: http://drools.46999.n3.nabble.com/master-BZ-1069337-fix-incremental-compi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years