Remove rule but timer still fires
by Ladd
I have a rule which runs every 2 seconds using
*timer( int: 0ms 2s )*
When I either disable
*rule.setEnabled( new EnabledBoolean( false ) );*
or remove the rule
*pkg.removeRule( rule );*
the timer continues to fire every 2 seconds.
This is with version 5.4.
I haven't been able to find the API for cancelling or stopping a timer. Can
anyone point me in the right direction?
Thanks for the help!!
- Ladd
--
View this message in context: http://drools.46999.n3.nabble.com/Remove-rule-but-timer-still-fires-tp401...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Guvnor search for rules based on fact attributes
by Stephen Masters
Hi folks,
I have been asked by my current client to evaluate search functionality which could in essence search for rules which are affected by a particular fact value.
For example, if we have a number of rules similar to the following format:
when
$req : TradeRequest(account = 10, buyCurrency = 'EUR', buyAmount > 5000000)
then
TradeValidationResponse response = new TradeValidationResponse();
response.setPermitted(false);
response.setMessage("Account 10 is not permitted to trade more than 5000000 EUR");
insert(response);
end
What the client is interested in is being able to search for all rules which have been defined for account 10.
I was thinking to mess around with a rather quick and dirty solution to grab the package source via the REST interface and pattern match rules in a very hard-coded way for this specific use-case. However, that does look like a rather fragile way of achieving this.
So I was wondering whether anybody had looked at this sort of idea previously and might have thoughts on a 'better' or more generic solution, which wouldn't be massively complicated. I was thinking that it might be nice to extend the search mechanism in Guvnor so that I could pick a fact from the model and do a search for all rules which are based on the value of an attribute. However, every time I think about how that could be achieved, it seems I come up with new ways in which it would become really difficult to pull off.
Any thoughts?
Cheers,
Steve
12 years, 4 months
Slow compilation (4h) for a single rule
by fx242
Hi,
Recently I was trying to optimize the rule compilation time for my KB (~4K
rules).
I do a full KB compilation every night, as most of the rules are dynamic
generated/converted and managed by the business operators.
The compile time was not very good (around 3 hours on a 8 core Xeon CPU),
but is was acceptable.
On the other night I was alarmed that the compile time was doubled overnight
without an obvious explanation or any relevant rule count increase. After
some debuging I've traced the problem and was shocked to find that most of
the rules KB (4K rules) compile under 5 minutes, except one. This single
rule was taking all the 4h to compile!
I'm using DROOLS 5.2 Final.
The rule example below samples the problem (don't mind the nonsense Number()
conditions):
rule "CONFIG_1-3UCO07"
salience -90
when
Number(rel_4226982244: intValue)
Number(rel_7521194: intValue)
Number(rel_787633980: intValue)
Number(qty_1331544548: intValue)
Number(rel_1425187049: intValue)
Number(rel_1180441096: intValue)
Number(rel_3132221704: intValue)
Number(rel_1663554156: intValue)
Number(rel_1940612775: intValue)
Number(rel_1735126416: intValue)
Number(rel_3962361266: intValue)
Number(rel_882187: intValue)
Number(rel_1169008280: intValue)
Number(rel_3495503197: intValue)
Number(rel_70290066: intValue)
Number(rel_1333860961: intValue)
Number(rel_2793542368: intValue)
Number(rel_952404632: intValue)
Number(rel_2712335119: intValue)
Number(qty_4276673135: intValue)
Number(qty_3950051097: intValue)
Number(rel_3391032645: intValue)
Number(rel_2738029181: intValue)
Number(qty_4125201080: intValue)
Number(rel_663254919: intValue)
Number(rel_3059142355: intValue)
not((eval(qty_1331544548 == 1) or eval(rel_1425187049 == 1) or
eval(rel_1180441096 == 1) or eval(rel_787633980 >= 1) or eval(rel_7521194 >=
1) or eval(rel_4226982244 >= 1) or eval(rel_2712335119 == 1) or
eval(qty_3950051097 == 1) or eval(qty_4276673135 == 1) or
eval(rel_1940612775 == 1) or eval(rel_3132221704 == 1) or eval(rel_882187 ==
1) or eval(rel_1663554156 == 1) or eval(rel_1735126416 == 1) or
eval(rel_3962361266 == 1) or eval(rel_1169008280 == 1) or
eval(rel_2793542368 == 1) or eval(rel_3495503197 == 1) or
eval(qty_4125201080 == 1) or eval(rel_70290066 == 1) or eval(rel_3391032645
== 1) or eval(rel_1333860961 == 1) or eval(rel_2738029181 == 1) or
eval(rel_663254919 == 1) or eval(rel_952404632 == 1) or eval(rel_3059142355
== 1)))
then
vh.error(kcontext, "Error ...");
end
I've noticed that the last "not(...)" is the problematic condition. Is there
a limit using eval() and or-clauses, or a known problem?
Regards,
Tiago Lopes
--
View this message in context: http://drools.46999.n3.nabble.com/Slow-compilation-4h-for-a-single-rule-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Moving comment in DSLR file causes issue under 5.3
by drdaveg
This is an odd one. I was testing some DSL and have been tracing back an
error in the translation. The line marked in the code below, even as a
comment, causes multiple "cannot be resolved" errors when moved. Any
thoughts on what could cause this other than a bug?
Note that almsot all of the code is commented and as it appears now
generates the errors. If I move the line to the LHS the "cannot be
resolved" errors go away. The only interesting thing shown in the DRL
viewer is that some of the comments appear duplicated.
rule "Compute"
when
# Fare(fareBasisCode == fp1)
# ts1 : TrainSegment(fl1 : fareList)
# ts2 : TrainSegment(fl2 : fareList)
# mySol : Solution()
> Fare(fp1 : fareBasisCode, thruFare == true)
> x : FQ3()
# eval(fl1.get(fp1 )!=null)
# eval(fl2.get(fp1 )!=null)
# eval(mySol .nthSegment(ts1)==(mySol .nthSegment(ts2)+1))
then
# > //int n = fq.nthSegment(fp1) ****** moving this line can cause a
syntax error
# > FQ3 test = new FQ3(); test = fq;
> System.out.println(fp1);
> x.setPassengerString("T"); // x.getPassengerString()+
end
--
View this message in context: http://drools.46999.n3.nabble.com/Moving-comment-in-DSLR-file-causes-issu...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
java.lang.NullPointerException at org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:56)
by Carolina Pellecchia
*Hi everyone! *
*I'm loading from Guvnor5.3.0 the pkg below ** into my application. *
*package* org.dfms.model;
*import* org.dfms.model.observation.ACObservation;
*import* org.dfms.model.situation.AccessControlEvent;
*import* org.dfms.model.situation.SituationManager;
*import* org.dfms.model.situation.Event;
*import* org.dfms.model.mapfeature.AccessControlPoint;
*import* java.util.HashSet;
*import* java.util.ArrayList;
*declare* ACObservation
@role(event)
*end*
*declare* AccessControlEvent
@role(event)
*end*
*rule* "AccessControl"
*no-loop*
*when*
$obs : ACObservation( $sensorid : sensorId, $location :
location ) over window:length(1) *from* entry-point access_control
*then*
*insert*( SituationManager.createAccessControlEvent( $obs, "Access
Control Detection", Event.THREAT_NO, $location, $sensorid ));
*end*
*When the rule is executed the application get this exception:*
[*java*] ERROR [2012-07-20 14:32:17,422] [Thread-19] (*
ExpertSystemManager.java:162*) - *java.lang.NullPointerException*
[*java*] *java.lang.NullPointerException*
[*java*] at
org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(*
ReteooFactHandleFactory.java:56*)
[*java*] at
org.drools.common.AbstractFactHandleFactory.newFactHandle(*
AbstractFactHandleFactory.java:80*)
[*java*] at
org.drools.common.AbstractFactHandleFactory.newFactHandle(*
AbstractFactHandleFactory.java:65*)
[*java*] at org.drools.common.NamedEntryPoint.createHandle(*
NamedEntryPoint.java:720*)
[*java*] at org.drools.common.NamedEntryPoint.insert(*
NamedEntryPoint.java:280*)
[*java*] at org.drools.common.NamedEntryPoint.insert(*
NamedEntryPoint.java:116*)
[*java*] at org.drools.common.NamedEntryPoint.insert(*
NamedEntryPoint.java:48*)
[*java*] at org.tass.utils.ExpertSystemManager.insertObservation(
*ExpertSystemManager.java:156*)
[*java*] at org.tass.vsensor.ExpertVS.dataAvailable(*
ExpertVS.java:59*)
[*java*] at gsn.beans.InputStream.executeQuery(*
InputStream.java:277*)
[*java*] at gsn.beans.StreamSource.windowSlided(*
StreamSource.java:325*)
[*java*] at
gsn.beans.windowing.SQLViewQueryRewriter.dataAvailable(*
SQLViewQueryRewriter.java:83*)
[*java*] at
gsn.beans.windowing.TupleBasedSlidingHandler.dataAvailable(*
TupleBasedSlidingHandler.java:56*)
[*java*] at gsn.wrappers.AbstractWrapper.postStreamElement(*
AbstractWrapper.java:222*)
[*java*] at
gsn.http.rest.LocalDeliveryWrapper.writeStreamElement(*
LocalDeliveryWrapper.java:147*)
[*java*] at
gsn.http.rest.DefaultDistributionRequest.deliverStreamElement(*
DefaultDistributionRequest.java:57*)
[*java*] at gsn.DataDistributer.flushStreamElement(*
DataDistributer.java:165*)
[*java*] at gsn.DataDistributer.run(*DataDistributer.java:220*)
[*java*] at java.lang.Thread.run(*Thread.java:662*)
*How can I solve this issue?*
*
Thank you in advance,
Carolina Pellecchia*
12 years, 4 months
Drools/Tomcat/Mysql - dueling repository.xml's
by mfeber
I am fairly new to Drools. I am using guvnor 5.4.0. Final installed on
Tomcat 7.0.27. Following the instructions in the documentation, I
1) Defined/downloaded the a repository.xml pointing to a mysql instance
using the Administration -> Repository Configuration wizard.
2) Stopped Tomcat, removed the $CATALINA_HOME/bin/repository.xml and
repository directory
3) Copied the new repository.xml to $CATALINA_HOME/bin
4) Started Tomcat
5) Using guvnor, my assets were created/stored in the mysql db
6) Stopped Tomcat
7) Started Tomcat
8) Guvnor wrote a new repository.xml into $CATALINA_HOME (NOT
$$CATALINA_HOME/bin which still contained the db version created in step 1.)
and had 'forgotten' about the assets created in step 5.
9) Stopped Tomcat
10) Replaced the $CATALINA_HOME/repository.xml with a copy of the
$CATALINA_HOME/bin/repository.xml.
11) Started Tomcat
12) Guvnor started using the mysql instance again and 'remembered' the
assets from step 5
Now there are two repository.xml files in $CATALINA_HOME and
$CATALINA_HOME/bin. This should not be necessary re the documentation.
Why did it create a new repository/repository.xml in $CATALINA_HOME after a
Tomcat restart?
Which repository.xml is it really using now?
How can I convince it to only use one of them?
[Also of note: the workspace.xml files in
$CATALINA_HOME/repository/workspaces/default and
$CATALINA_HOME/bin/repository/workspaces/default are identical after step
11.]
Thanks,
Mark
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Tomcat-Mysql-dueling-repository-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
MVEL optimizer error
by gboro54
I am having an issue with an optimizer stack trace on my linux QA box that I
can't seem to reproduce on my windows development box. The stack trace is:
13:01:50,188 ERROR [stderr] (Thread-123) Exception in thread "Thread-123"
java.lang.RuntimeException: unable to invoke method:
com.billing.domain.context.OrderSideContext.getPrimarySide: target of method
is null
13:01:50,188 ERROR [stderr] (Thread-123) at
org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:66)
13:01:50,189 ERROR [stderr] (Thread-123) at
org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
13:01:50,189 ERROR [stderr] (Thread-123) at
org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
13:01:50,189 ERROR [stderr] (Thread-123) at
org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
13:01:50,189 ERROR [stderr] (Thread-123) at
org.mvel2.ast.And.getReducedValueAccelerated(And.java:34)
13:01:50,189 ERROR [stderr] (Thread-123) at
org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
13:01:50,190 ERROR [stderr] (Thread-123) at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
13:01:50,190 ERROR [stderr] (Thread-123) at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:116)
13:01:50,190 ERROR [stderr] (Thread-123) at
org.mvel2.MVEL.executeExpression(MVEL.java:930)
13:01:50,190 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
13:01:50,190 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConditionEvaluator.ensureBranchEvaluation(MvelConditionEvaluator.java:113)
13:01:50,191 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:106)
13:01:50,191 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:90)
13:01:50,191 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:82)
13:01:50,191 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:214)
13:01:50,191 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConstraint.access$000(MvelConstraint.java:41)
13:01:50,192 ERROR [stderr] (Thread-123) at
org.drools.rule.constraint.MvelConstraint$1.run(MvelConstraint.java:201)
13:01:50,192 ERROR [stderr] (Thread-123) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
13:01:50,192 ERROR [stderr] (Thread-123) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
13:01:50,192 ERROR [stderr] (Thread-123) at
java.lang.Thread.run(Thread.java:662)
13:01:50,192 ERROR [stderr] (Thread-123) Caused by:
java.lang.NullPointerException
13:01:50,193 ERROR [stderr] (Thread-123) at
sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
13:01:50,193 ERROR [stderr] (Thread-123) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13:01:50,193 ERROR [stderr] (Thread-123) at
java.lang.reflect.Method.invoke(Method.java:597)
13:01:50,193 ERROR [stderr] (Thread-123) at
org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:40)
13:01:50,193 ERROR [stderr] (Thread-123) ... 19 more
We are using a CENTOS with Java 1.6._31 and drools 5.4.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/MVEL-optimizer-error-tp4018714.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Using Global Model for all packages
by starfish15
Hi Admins,
I have been using GUVNOR 5.2 from sometime now. We have different packages
created, as per the requirement of different teams. However, they do use the
same MODEL. I was wondering if we could simply upload a jar in the global
area, and use the same in every other package. I know that we can create
models for each package and say Import asset from global area. However doing
the same again and again, isnt helping me in any manner.
The rules arent getting updated with the class files and the rules
validation failes with in the Business Rule Assets.
Is it that this doesnt work or is it that am missing on something???
Kindly assist ASAP.
Regards,
starfish
--
View this message in context: http://drools.46999.n3.nabble.com/Using-Global-Model-for-all-packages-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Guvnor5.4 and JBPM5.3 web designer error with IE8
by Ricardo
Hi,
I am tring to open JBPM5.3 web designer in Guvnor5.4 running in JBossAS7,
but fails to open, when I try to open a pop up window says that ' checking
chrome frame' if you click the ok button in this pop-up window , it opens a
new IE window with chrome plug-in information and Guvnor not display the web
designer insted a window popup and says designer loading...but designer not
loading...for ever...
any help will be appriciated...
thanks,
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor5-4-and-JBPM5-3-web-designer-erro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months