6.0.1.F How to set Maven repo used by KieScanner?
by SrjTx
I am doing the following, but no rules ever fire. I suspect the maven repo
location is not right -and that no rules are getting loaded - how do I set
it?
I am using /root/.m2/repository
It would be the programmatic equivalent of
-Dorg.guvnor.m2repo.dir=/root/.m2/repository"
Also, how do you list the rules that are in the base? I see there is a
getRule(...), but no getRules.
kieServices = KieServices.Factory.get();
releaseId = kieServices.newReleaseId("com.xyz.policy", "cep",
"LATEST");
kieContainer = kieServices.newKieContainer(releaseId);
kieBase = kieContainer.newKieBase(config);
kieSession = kieBase.newKieSession();
kieSession.addEventListener((RuleRuntimeEventListener) this);
kieScanner = kieServices.newKieScanner(kieContainer);
kieScanner.start(10000L);
--
View this message in context: http://drools.46999.n3.nabble.com/6-0-1-F-How-to-set-Maven-repo-used-by-K...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
NullPointerException with kie-spring 6.0.1 and Spring 4.0
by Andrew Berman
Hello,
I'm trying to play around with Drool 6.0.1 integration with Spring (I'm
using spring-boot which includes spring 4.0). I've looked at the unit
tests written and have copied them pretty much exactly. When I start the
app, I consistently receive:
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.kie.spring.KModuleBeanFactoryPostProcessor]:
Constructor threw exception; nested exception is
java.lang.NullPointerException
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:164)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
... 22 more
Caused by: java.lang.NullPointerException
at
org.kie.spring.KModuleBeanFactoryPostProcessor.initConfigFilePath(KModuleBeanFactoryPostProcessor.java:79)
at
org.kie.spring.KModuleBeanFactoryPostProcessor.<init>(KModuleBeanFactoryPostProcessor.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
When debugging the NPE comes from line 79,
getClass().getResource("/").getPath(), because getResource yields null.
Here is my spring context file:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:kie="http://drools.org/schema/kie-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://drools.org/schema/kie-spring http://drools.org/schema/kie-spring.xsd
">
<kie:kmodule id="kmodule">
<kie:kbase name="kbase1" packages="rules.drools">
<kie:ksession name="ksession">
<kie:consoleLogger/>
</kie:ksession>
</kie:kbase>
</kie:kmodule>
<bean id="kiePostProcessor"
class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>
</beans>
Can someone help out?
Thanks!!
11 years, 9 months
Rules updating error
by Ioannis Christodoulou
In my java ee application, I use drools 6.1.0.Beta1, deployed on jboss eap
6.2 (I have also deployed Kie Workbench 6.0.1.Final).
In order to get the latest updates on my rules (made on kie wb) I tried to
set kiescanner to "LATEST". This seems to not be working always (I'm not
100% sure about the reason, it seems to happen when I have not re-deployed
the jar with the model classes I use in my rules, or I have not clicked on
build&deploy of the rules project), so I have reverted to using "1.0" as
the version and not changing the version when I update the rules project.
There is an issue with the application not validating, because I have a
guided decision table which uses a global variable and a function, but that
seems to not be an error after all (everything seems to build as it should).
However, while my application is running (and watching for updates through
scanner), if I make an update and deploy the rules project again, the
application retrieves the update and fails with a validation error about
not being able to analyse the expressions regarding the global function and
the global variable.
Any suggestions?
Thank you very much.
11 years, 9 months
Needs advice to help Drools on a big problem (and avoid GC overhead)
by Raphael
Hi,
In our project, we use Drools to compute forbidden allocations as input for
an allocation problem (for which we do not use Drools BTW).
The constraint of the problem (forbidden operation for given resources) are
expressed as drools rules.
We have about
-200 resources
-700 operations
Those are the Drools facts.
We have about 200 Drools rules describing the forbidden allocations
The problem here is that many rules produce duplicates forbids.
For instance :
Rule 1 may forbid Op1 on Res1 & Res3
Rule 2 may forbid Op1 on Res2 & res3
Currently the RHS of rules just insert forbids into a pure Java Set (no fact
insertion).
The Set takes care of avoiding duplicates, but still, we feel we could help
Drools by giving him a hint that
all rules are actually producing pairs of <Resource, Allocation> and that he
should not try to produce them more than once.
Currently the structure of each rule looks like that :
when
$resource : Resource(<someconditions>)
$operation : Operation(<someconditions>)
then
globalSet.add(Pair<resrouce, operation>)
end
With the size of the problem, we often end up with outOfMem/ GC limit.
When analyzing memory dump, we see about
300.000 drools left tuple object.
I am not sure if we could help drools to reduce the Rete tree here.
I mean, the allocation matrix is already : 200*700 = 140.000 cells.
Drools only uses 2 nodes for each possible forbids, which seems already well
optimized.
We had several idea to improve that though, but we are not enough expert in
the internal of the RETE algorithm to decide if that's a good way to go :
1) Insert forbids as facts in the RHS and check they are not already there
in the LHS :
when
$resource : Resource(<someconditions>)
$operation : Operation(<someconditions>)
not Forbid(res=$resource, op=$operation)
then
insert(Forbid($resource, $operation))
end
2) Merge all rules in one big rule with a single RHS
Is it possible to have something like :
when
// Rule 1
($resource : Resource(<someconditions>)
$operation : Operation(<someconditions>))
or
// Rule 2
($resource : Resource(<someconditions>)
$operation : Operation(<someconditions>))
// Etc ...
then
globalSet.add(Pair<resrouce, operation>)
end
3) Define a common RHS somewhere and tell Drools all rules use this one.
Is there a possibility in Drools to define reusable RHS ? Would it help ?
4) Any other idea ?
Thanks in advance for your help.
Brgds,
Raphael Jolivet
--
View this message in context: http://drools.46999.n3.nabble.com/Needs-advice-to-help-Drools-on-a-big-pr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
cannot copy guided decision table
by Ioannis Christodoulou
I tried to copy a guided decision table in kie workbench 6.0.1.Final
It created the new decision table, but the generated drl (which can be
viewed from the 'source' tab)
cannot be validated, because the generated rule names are the same with the
copied decision table.
For example, copying the guided decision table: guided_decision_table.gdst
to rules2.gdst will not change the generated rules names, they will still
be:
rule "Row 1 guided_decision_table".
Is there something I can do about it ?
11 years, 9 months
How to allow non-programmers/non-Drools programmers to define rules
by ankit3j
I am a newbie to Drools and have been looking for a way to allow
non-programmers, mostly administrative guys, to define rules using a simple
language format and minimum coding terms/effort. I came across the concept
of DSL and DSLR and found it useful.
However, it seems that to use DSL one needs to have a knowledge of
domain(Java) objects defined. Not only does it defeat the purpose it also
exposes my Java objects to users. DSLR seems to be a better alternative
which can be modified by user. But it seems that DSLR is derived from DSL.
Which one of these 2 should actually be defined/written by user and uploaded
in the system so that backend can create rules based on it?
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-allow-non-programmers-non-Drools...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
Configuring kie: namespace for Spring.
by milen igrachev
Hello,
can someone please paste me his definition of the xmlns:kie in the spring configuration.
I read the documentation and I got the configuration principles, but I cannot find the namespace definition in the net. A simple paste of the header xmlns:*/schemaLocation will be perfect.
Thanks in advance! M.
11 years, 9 months
Want to post to this list
by Ankit Jain
Hi,
I am Ankit Jain, a newbie to Drools. In order to get my queries answered I
would like to post to this mailing list.
Regards
Ankit
11 years, 9 months