Not able to debug Drools Rules
by Annie
Hi,
I am using 'drools-distribution-5.4.0.Final' and 'eclipse helios 3.6.2' . I
have created a simple example using rules, it runs correctly but when trying
to debug it as drools application I got the following error in 'error log' :
Plug-in 'com.google.gwt.eclipse.core' contributed an invalid Menu Extension
(Path:
'com.google.gdt.eclipse.suite.popupMenu.file' is invalid):
com.google.gwt.eclipse.core.actions.AddResourcesToClientBundleAction
Can anyone help me to identify the problem?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Not-able-to-debug-Drools-Rules-tp401813...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
issue with date comparison
by sumatheja
Hi,
I've a fact which is retrieved from database using hibernate. The date
format that comes in is "yyyy-mm-dd", java.util.Date. The fact has two
variables *startDate* and *endDate. *I want to check if the the *current
date* lies between these two. Since the current date is not constant I'm
trying to use a global variable, which I would setbefore firing the rules.
My question is what should be the datatype of this global variable. If I
use Date the format is completely different. If I use String it says that
date can't be compared with string.
However if I hard code the value of current date in "*dd-MMM-yyyy*"
rule fire fine. Can someone please suggest me a way to achieve this. Thanks
in advance.
--
cheers
Sumatheja Dasararaju
14 years
Odd rules execution for expired events
by sopel39
Hi,
I have declared two types:
declare Motion
@role( event )
@expires( 5s )
@timestamp( eventTime )
eventTime : long
end
declare Recording
end
and following rules:
rule "StartRecording"
when
Motion()
not Recording()
then
insert(new Recording())
end
the problem is that when I put a lot of "motions", sleep (so "motions"
become expired) and then do fireAllRules(), I got "StartRecording" executed
multiple times (and not only once), event though Recording is inserted every
time.
It seems that inserting new recording does not cancel expired activations.
Is that correct? How to handle such situation correctly?
--
View this message in context: http://drools.46999.n3.nabble.com/Odd-rules-execution-for-expired-events-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
java.lang.NullPointerException at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
by prem.kishore
Hi ,
I've below rule set up in Guvnor . This rule works fine when other java
application starts up and fetched the rule from Guvnor using knowledge Agent
.
rule "EL-AH-RESTRICT-LOGIN"
no-loop true
dialect "mvel"
when
lcki : LoginChallengeKI( eval( (lcki.getWS_RiskScore() >=
790 && (lcki.getWS_RiskScore() - lcki.getAvgRiskScore()) >= 500) ||
(lcki.getWS_RiskScore() >= 750 && ((lcki.getWS_RiskScore() -
lcki.getWS_RiskScore())/lcki.getWS_RiskScore()) >= 4) ||
(lcki.getWS_RiskScore() >= 750 && lcki.getWS_RiskScore() <= 350 ) ),
userEquityBalance >= 40 , hadPreviousChallenge == false , eval(
!lcki.getValidCookies().contains(lcki.getWS_Cookie()) &&
!lcki.getValidCookies().contains(lcki.getWS_FlashCookie()) ), eval(
lcki.getWS_IPAddr() != lcki.getIpAddr1() && lcki.getWS_IPAddr() !=
lcki.getIpAddr2() ), eval( lcki.getWS_Cookie() != lcki.getCookie1() &&
lcki.getWS_Cookie() != lcki.getCookie2() ), eval( lcki.getWS_FlashCookie()
!= lcki.getFlashCookie1() && lcki.getWS_FlashCookie() !=
lcki.getFlashCookie2() ), eval( lcki.getWS_GeoCity() != lcki.getGeoCity1()
&& lcki.getWS_GeoCity() != lcki.getGeoCity2() ), eval(
CheckAfterHour(lcki.WS_EventTimeStamp) ))
then
lcki.setRuleIDMapValue("ACT03","EL-AH-RESTRICT-LOGIN");
lcki.setChallenge(true);
lcki.setGenerateAlert(true);
end
But if i make any change in the in the guvnor and build the pkg then other
application throws below exception
org.drools.RuntimeDroolsException: Exception executing predicate
(lcki.getWS_RiskScore() >= 790 && (lcki.getWS_RiskScore() -
lcki.getAvgRiskScore()) >= 500) || (lcki.getWS_RiskScore() >= 750 &&
((lcki.getWS_RiskScore() - lcki.getWS_RiskScore())/lcki.getWS_RiskScore())
>= 4) || (lcki.getWS_RiskScore() >= 750 && lcki.getWS_RiskScore() <= 350 )
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:191)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at
com.etrade.jws.actimize.rule.RuleServiceImpl.applyLoginRules(RuleServiceImpl.java:38)
at
com.etrade.jws.actimize.service.LoginChallengeImpl.getLoginChallengeDecision(LoginChallengeImpl.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
at
org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:423)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:178)
at
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
... 48 more
org.drools.RuntimeDroolsException: Exception executing predicate
(lcki.getWS_RiskScore() >= 790 && (lcki.getWS_RiskScore() -
lcki.getAvgRiskScore()) >= 500) || (lcki.getWS_RiskScore() >= 750 &&
((lcki.getWS_RiskScore() - lcki.getWS_RiskScore())/lcki.getWS_RiskScore())
>= 4) || (lcki.getWS_RiskScore() >= 750 && lcki.getWS_RiskScore() <= 350 )
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:191)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at
com.etrade.jws.actimize.rule.RuleServiceImpl.applyLoginRules(RuleServiceImpl.java:38)
at
com.etrade.jws.actimize.service.LoginChallengeImpl.getLoginChallengeDecision(LoginChallengeImpl.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
at
org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:423)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:178)
at
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
... 48 more
--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-NullPointerException-at-org-d...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Possible to use functions in DRL when dialect is mvel?
by Stephen Masters
Hi folks,
Is it possible to refer to DRL functions from a DRL when the dialect is mvel?
I have been working on unit tests for a rule that were consistently failing due to not being able to find the function that should be imported. Having tried various formats (the documentation is rather unhelpful here) for the import, I thought I'd see what happened if I just switched to the Java dialect. Suddenly it worked without even needing an import statement.
Unfortunately, this forces me to switch from the neat ...
newFact.Property = otherFact.Property
... to the rather ugly Java-style
newFact.setProperty(otherFact.getProperty())
So I would quite like to know if there is an undocumented (or well-hidden-documented) mechanism for using functions when in mvel dialect. Or am I stuck with switching to Java?
Thanks in advance for any pointers anybody can provide,
Steve
14 years
Guvnor execution server getting 401 when using AD-configured Guvnor as endpoint
by ndipiazza
We are using:
• Drools Execution Server that came with Drools 5.1
• Drools Guvnor 5.2 configured with active directory
The execution server and guvnor run on the same Tomcat and use the same
port.
With the execution server you can have a listener for each package within
the configuration file. I have two such files, from-file-system.properties
that points to a local directory where a drools binary package is manually
deployed. This works fine.
But I try to use with-guvnor.properties which points to a package binary on
5.3 Guvnor. Here is the file:
I get the following error:
Some sort of authorization error very likely related to the active directory
configuration within Guvnor 5.2.
This used to work for us just fine with an earlier version of Guvnor.
This used to work for us just fine with an earlier version of Guvnor.
How can I fix this issue?
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-execution-server-getting-401-whe...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
drools-planner-distribution5.4 final unzipping error....
by domingo
Hi,
I am try to unzip the drools-planner-distribution-5.4.0.final.zip, while
unzipping I got the following warnig messages...
DeciderScoreComparatorfact...is password protested.Please enter the
passwordin the box..
File 'initializer' is password protected.Please enter the passwordin the
box..
File 'Factory' is password protected.Please enter the passwordin the box..
File 'MachineReassignmentSolution' is password protected.Please enter the
passwordin the box..
File 'MrOriginalMacineSolutionIn..' is password protected.Please enter the
passwordin the box..
File 'EmployeeConsecutiveAssignment' is password protected.Please enter the
passwordin the box..
...........
..............etc
I suspect some of the files are password protected...how to get rid of this?
thanks
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/drools-planner-distribution5-4-final-un...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years