Drools upgrade from 3 to 5 - '||' OR syntax
by Nars
We are migrating couple hundred rules from Drools 3 to 5.
We have rules like below.
rule "Test rule"
salience 100000
when
core : BWCore(systemId == "1" ) ||
BWCore(systemId == "2" ) ||
BWCore(systemId == "3")
then
System.out.println( "bwid: " + core.getBWIntId());
end
This rule works fine in 3, but in 4 and 5 it throws below exception when we
insert a BWCore object with systemId 2. The same works fine if the object
inserted has systemId as 1.
org.drools.runtime.rule.ConsequenceException: java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
at com.sample.BWTest.main(BWTest.java:32)
Caused by: java.lang.NullPointerException
at org.drools.reteoo.LeftTuple.get(LeftTuple.java:300)
at
com.sample.Rule_Make_BossBWs_FABWs_and_TMCBWs_retail_bws_0ConsequenceInvoker.evaluate(Rule_Make_BossBWs_FABWs_and_TMCBWs_retail_bws_0ConsequenceInvoker.java:15)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
... 6 more
Is this kind of || syntax no longer supported in 4 and 5?
Thanks
--
View this message in context: http://n3.nabble.com/Drools-upgrade-from-3-to-5-OR-syntax-tp471205p471205...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Guvnor users and case sensitivity
by Régis Ramillien
Hello all,
I wonder if I can easily disable the case sensitivity for the user login in
guvnor.
My users credentials are stored in an LDAP and the server does not ask for
case sensitivity.
Therefore, for each application, if a user is named "fr001", he can also log
as "FR001".
But in guvnor, if the administrator create the user "fr001", then, this user
will not be able to log as "FR001" even if he is successfully authenticated.
Guvnor returns the error "This user has no permissions setup.".
Can we easily disble this, please ?
Regards,
Régis Ramillien
14 years, 9 months
Process with WSHumanTaskHandler
by nanic23
Before I try to get an example working I thought it would be a good idea to
post this as it might just be a quick answer to my question.
Lets say I have a process with a Human Task and I'm using
WSHumanTaskHandler.
(Start) --> [Action] --> [Human Task] --> [action] --> ......... --> (end)
The process requires manual intervention (approval from supervisor) so when
I get to Human Task my process will get persisted.
Now, it is not until next day that the supervisor makes the approval and the
Human Task gets mark as completed.
Question: will my process be resumed after this and run to completion? or
human task will be marked as complete but process will NOT continue?
Thanks!!!
--
View this message in context: http://n3.nabble.com/Process-with-WSHumanTaskHandler-tp469303p469303.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Process in GWT Console
by nanic23
I can run simple processes through the gwt console but now I'm trying to
deploy a process that uses a WorkItemHandler. Gwt console server doesn't
know about this work item handler and when execution gets to that point it
complains saying that it didn't find a work item (Of course!!!).
So, question is..... How do I register my work item handler and make
gwt-console-server aware of it so it can find it at execution time?
Thanks
--
View this message in context: http://n3.nabble.com/Process-in-GWT-Console-tp468883p468883.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Junit, PseudoClock and NPE
by Makewise - Vitor Rui Mendonça
Hi folks!
First time in this mailing-list, with very little experience in Drools (Fusion, regarding CEP).
I hope that someone could help me out J
I've being investigating about this issue and I'm not getting any answer.
Here's the problem:
I've got a DRL file with a simple rule:
rule "...."
when
$offline : Event( code == "101", $offlineLane : lane ) from entry-point "incoming"
not ( $online : Event(code == "102", lane == $offlineLane, this after [0s,3m] $offline ) from entry-point "incoming" )
then
// some code here
end
What I want is: when there's an offline for more than 3 minutes *without* any online event (meanwhile), that execute the rule.
I've got JUnits, with Drools configured with STREAM mode and PSEUDO clock.
All is good in JUnit world except in this testcase:
· Insert an offline event (workingMemoryEntryPoint.insert( offlineEvent );)
· Clock advances 2m50s (clock.advanceTime(2,TimeUnit.MINUTES );clock.advanceTime(50, TimeUnit.SECONDS );)
· Insert an online event (workingMemoryEntryPoint.insert( onlineEvent );)
· Clock advances 0m15s (clock.advanceTime(15,TimeUnit.SECONDS );)
· Assertion error: the rule runs when it shouldn't (online event cancels offline event).
I've got no clue about this but I have some more interesting info:
· When clock advances 0m15s, there's an NPE on a LinkedList:
java.lang.NullPointerException
at org.drools.util.LinkedList.remove(LinkedList.java:113)
at org.drools.common.Scheduler$DuractionJob.execute(Scheduler.java:71)
at org.drools.time.impl.PseudoClockScheduler$ScheduledJob.call(PseudoClockScheduler.java:219)
at org.drools.time.impl.PseudoClockScheduler.runCallBacks(PseudoClockScheduler.java:168)
at org.drools.time.impl.PseudoClockScheduler.advanceTime(PseudoClockScheduler.java:130)
· I haven't any code/rule that retracts events (I shouldn't have it for this case, right?)
· I've tried Drools 5.0.1 and 5.1.0.M1, with the same results
· The issue causing NPE, I've found an old issue regarding Drools 3.0.4 and the bug was corrected in 3.0.5 (https://jira.jboss.org/jira/browse/JBRULES-455)
· I think that someone wrote about this error (in Drools 5) but I don't have the link to it.
Thanks In Advance!
Best regards,
Vítor Mendonça Moreira
Analista / Programador
Direcção de Investigação e Desenvolvimento
Rua Dr. Francisco Sá Carneiro, nº. 4 r/c esq.
2500 - 206 - Caldas da Rainha
Tel: (+351) 262 832 196
Fax: (+351) 262 186 455
Web: www.makewise.pt <http://www.makewise.pt>
Uma empresa: Grupo Sousa Pedro <http://www.sousapedro.com>
14 years, 9 months
NullPointerException while inserting Facts
by Sebastian Furth
Hi,
we are currently trying to integrate DROOLS 5.1 in our project.
In our Project we have two different kinds of Facts, called Values and
Inputs. We don't have any problems with inserting Input instances but
sometimes when we try to insert an instance of the Value class (@see:
http://www.pastie.org/private/juv7hh7rxahpluo5agu3q) we get the following
NullPointerException:
java.lang.NullPointerException
at org.drools.reteoo.LeftTuple.get(LeftTuple.java:265)
at org.drools.reteoo.LeftTuple.get(LeftTuple.java:300)
at
org.drools.rule.VariableRestriction$ObjectVariableContextEntry.updateFromTuple(VariableRestriction.java:320)
at
org.drools.common.SingleBetaConstraints.updateFromTuple(SingleBetaConstraints.java:119)
at org.drools.reteoo.NotNode.assertLeftTuple(NotNode.java:98)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:34)
at org.drools.reteoo.NotNode.assertLeftTuple(NotNode.java:123)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:57)
at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:142)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:147)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1046)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1001)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:788)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:216)
at de.d3web.we.drools.DroolsAction.addFacts(DroolsAction.java:296)
at
de.d3web.we.drools.DroolsAction.createKnowledgeSession(DroolsAction.java:268)
at de.d3web.we.drools.DroolsAction.execute(DroolsAction.java:67)
The weird thing is that we don't get this exception with all instances of
the Value class - some of them can be inserted, others not. The objects are
created correctly - we've already debugged this. The crash happens somewhere
deeper in the drools api.
It would be really great if you could give us a hint how we could fix this
problem.
Thank you in advance.
Best regards
Sebastian Furth
14 years, 9 months
ClassCastExeception on some objects
by Martin Seebach
Hi,
When executing my rules for an object, on some objects I get a
ClassCastException:
java.lang.ClassCastException: org.drools.reteoo.CollectNode$CollectMemory
cannot be cast to org.drools.core.util.ObjectHashMap
at
org.drools.reteoo.RightInputAdapterNode.assertLeftTuple(RightInputAdapterNode.java:128)
(full stack-trace: http://pastie.org/877237)
I've looked around in the source around where this happens, and can't figure
out how it relates to my rules-file. (http://pastie.org/877238)
Any pointers on how to approach this problem?
Thanks!
Regards,
Martin Seebach
14 years, 9 months
Drools stateless session question
by Shah, Malay
Hi All,
We have an application that uses drools stateless session over a set of 35000 objects (taking about 40 MB heap) of different types. During profiling, I saw that for rules that perform joins between two huge object types data sets, lots of org.drools.reteoo.LeftTuple objects causing out of memory errors. We are using 5G heap, and have set property drools.sequential=true too. Is there any way we can decrease the memory usage while applying these rules? Drools documentation mentions for sequential mode, we should do the following, some of them I am not sure how to set:
* Turn off all node memories, except the right-input Object memory.
* Disconnect the LeftInputAdapterNode propagation, and have the Object plus the Node referenced in a Command object, which is added to a list on the WorkingMemory for later execution.
* Assert all objects, when all assertions are finished and thus right-input node memories are populated check the Command list and execute each in turn.
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.h...
Do we need to set some properties in RuleBaseConfiguration to make sure node memories are switched off? It would be great if we can somehow decrease the memory usage for stateless sessions? Has anybody come across such memory issues before? Correct me if I am wrong, but I think 35000 objects is not a lot of data for causing such issues.
Thanks
Malay
--------------------------------------------------------------------------
NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.
--------------------------------------------------------------------------
NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.
14 years, 9 months