issue in using packages
by Nair, Mahesh
H i
our ruleflow is coupled with a struts2 application. we use guvnor generated pkg files and create knowledgebase out of it and use a caching mechanism to store kbases for reuse.
when i create a ksession out of the kbase and start a process , it works for the first time . whenever i try to start the same process second time using the cached kbase, i get the following exception :
ERROR - ExceptionInterceptor.publishException(107) | ExceptionInterceptor received exception java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585) etc ...
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Caused by: java.lang.NoSuchMethodError: com.qwest.rx.ruleflow.Process_com_qwest_rx_ruleflow_0.action104(Lorg/drools/spi/
KnowledgeHelper;Lcom/qwest/rx/brain/drools/action/RceHolderUtil;Lorg/drools/spi/ProcessContext;)V
at com.qwest.rx.ruleflow.Process_com_qwest_rx_ruleflow_0Action104Invoker.execute(Process_com_qwest_rx_ruleflow_0Action104Invoker.java:21)
at org.drools.workflow.instance.impl.ExtendedNodeInstanceImpl.executeAction(ExtendedNodeInstanceImpl.java:66)
at org.drools.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerEvent(ExtendedNodeInstanceImpl.java:45)
at org.drools.workflow.instance.impl.ExtendedNodeInstanceImpl.internalTrigger(ExtendedNodeInstanceImpl.java:28)
at org.drools.workflow.instance.node.StateBasedNodeInstance.internalTrigger(StateBasedNodeInstance.java:31)
at org.drools.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:80)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:148)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:135)
at org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
at org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:16)
at org.drools.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:185)
at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:284)
at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1763)
at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1741)
at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:284)
at com.qwest.rx.brain.drools.action.GetNextPageletAction.execute(GetNextPageletAction.java:557)
... 98 more
when i try to create the kbase by parsing rf files directly , they are all working fine. the same caching mechanism works well with rf files parsed kbases.
any thoughts / suggestions?
Regards,
Dipasoke Chattopadhyay | * Office: +91 80 6618 4813 | Email: dipasoke.chattopadhyay(a)qwest.com<mailto:dipasoke.chattopadhyay@qwest.com>
________________________________
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
14 years, 9 months
Better way to find rule with max value
by Gaurav
Hi All,
I have aother question on drools.
There can le level1 to level6 present in a rule and we need to pick always
the highest level rule which satisfied list price and discount comdition.
Following code is giving me expected results but do we have any better way
to implement the same. Can I avoid last 2 iternations and combine it to
first one iteration.
RoutingRule.java
----------------
private String level1 = "";
private String level2 = "";
private String level3 = "";
private String level4 = "";
private String level5 = "";
private String level6 = "";
private String serviceSalesPath = "";
private String productSalesPath = "";
private String nonStdTerm = "";
private String currency = "";
private double listPriceFrom = Double.MAX_VALUE ;
private double listPriceTo = Double.MAX_VALUE ;
private double discountPriceFrom = 100;
private double discountPriceTo = 100 ;
private double nodeOfRule =0;
Rule
-----
$selectedTSSRulesWithOutHier : ArrayList()
from collect ($routingRule : RoutingRule(currency == $curr
&& (
listPriceFrom <= $tssListPrice && listPriceTo > $tssListPrice
&& discountPriceFrom <= $tssDisc && discountPriceTo > $tssDisc &&
nonStdTerm =="TSS" )
)
from $tssRoutingRuleList)
$lowestNodeTSS : Double(intValue > 0)
from accumulate ( RoutingRule($nodeOfRule : nodeOfRule)
from $selectedTSSRulesWithOutHier, max($nodeOfRule))
$lowestNodeTSSRule : ArrayList()
from collect( $ruleObj : RoutingRule( eval(nodeOfRule == $lowestNodeTSS) )
from $selectedTSSRulesWithOutHier )
Many thanks in advance,
Gaurav
--
View this message in context: http://n3.nabble.com/Better-way-to-find-rule-with-max-value-tp442484p4424...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
XStream, Pipeline
by Bertrand Grottier
Hello,
I still have a problem loading facts using XStream. The last line of the following code triggers a com.thoughtworks.xstream.mapper.CannotResolveClassException.
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
// Make the results, in this case the FactHandles, available to the user
Action executeResultHandler = PipelineFactory.newExecuteResultHandler();
// Insert the transformed object into the session associated with the PipelineContext
KnowledgeRuntimeCommand insertStage = PipelineFactory.newStatefulKnowledgeSessionInsert();
insertStage.setReceiver( executeResultHandler );
// Create the transformer instance and create the Transformer stage, where we are going from Xml to Pojo.
XStream xstream = new XStream();
Transformer transformer = PipelineFactory.newXStreamFromXmlTransformer( xstream );
transformer.setReceiver( insertStage );
// Create the start adapter Pipeline for StatefulKnowledgeSessions
Pipeline pipeline = PipelineFactory.newStatelessKnowledgeSessionPipeline( ksession );
pipeline.setReceiver( transformer );
// Instantiate a simple result handler and load and insert the XML
ResultHandlerImpl resultHandler = new ResultHandlerImpl();
InputStream is = new FileInputStream("D:/workspaces/prise_main_drools/src/main/rules/lproduits.xml");
pipeline.insert( is, resultHandler );
Any idea ?
Thank you in advance.
Regards,
Benoît
_________________________________________________________________
Consultez gratuitement vos emails Orange, Gmail, Free, ... directement dans HOTMAIL !
http://www.windowslive.fr/hotmail/agregation/
14 years, 9 months
high sailence event/utility rules and ruleflows
by H.C.
I have a number of business rules structured into ruleflow groups and a
ruleflow to determine the order of execution of these groups. At the same
time, I have a number of maintenance and utility rules that do side tasks
such as maintain counts or summations, detect error conditions etc. These
utility rules need to come in immediately whenever necessary and don't
belong to any one ruleflow group but should fire whenever needed anywhere.
In other rule engine products I have used event rules to accomplish this.
I drools I am trying to achieve the same with setting a high salience on
these rules and not tagging them with with a ruleflow group.
Will this work correctly in drools when used with ruleflows? Will all rules
within a particular ruleflow group fire and then re-fire if these
maintenance rules update facts in the LHS...or...will the entire flow
complete and only then will these maintenance rules be considered since they
don't have a flow group?
Are there other ways to accomplish what I describe in drools?
Thanks.
--
View this message in context: http://n3.nabble.com/high-sailence-event-utility-rules-and-ruleflows-tp44...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Problems count and sumarizing data in facts
by Yamil Bracho
Hi, I have two kind of facts in a map.There is a field called _TYPE_ (H)eader, D)etail)In the Header line I have two String fields, one for the number of details lines ("NU_REGISTROS") and another for the sum of the detail line ("MT_TOTAL")In the detail lines I only have a String field called "MONTO"
I would like to build two rules. One to check the count of detail lines versus the field in the header line so I wrote :
rule "Contador de lineas detalle vs Header" salience 10 when $numRecs : Number() from accumulate(Map(this["_TYPE_"] == "D", $d : this["_NUMLINE_"]), count($d)) $map : Map(this["_TYPE_"] == "H", this["NU_REGISTROS"] != $numRecs) then System.out.println("NumRecs=" + $numRecs); listBitacora.add(new BitacoraDTO($map.get("_NUMLINE_"), "Error en el Detalle: El número del lineas de detalle (" + $total + ") no empareja con lo del encabezado (" + $map.get("NU_REGISTROS") + ")")); end However I always got "NumRecs=1" when i print out the value of $numRecs but I am absolute sure there is two details lines... Second when i try to sumarize the total field in the details line i got (MONTO in the detail line is a string): rule "Sumatoria de lineas detalle vs Header" salience 10 when $total : Number() from accumulate(Map(this["_TYPE_"] == "D", $monto : this["MONTO"]), sum(eval(Double.valueOf((String) $monto )))) $map : Map(this["_TYPE_"] == "H", this["MT_TOTAL"] != $total) then System.out.println("TOTAL=" + $total); listBitacora.add(new BitacoraDTO($map.get("_NUMLINE_"), "Error en el Detalle: El número del lineas de detalle (" + $total + ") no empareja con lo del encabezado (" + $map.get("NU_REGISTROS") + ")")); end but I got Rule Compilation error : [Rule name='Sumatoria de lineas detalle vs Header'] rule/Rule_Sumatoria_de_lineas_detalle_vs_Header_0.java (9:1313) : The method eval(Double) is undefined for the type Rule_Sumatoria_de_lineas_detalle_vs_Header_0
Any help in those tow problems TIA
Yamil
_________________________________________________________________
Escucha a quienes ya han probado Windows 7 ¡Hazlo aquí!
http://www.sietesunpueblodeexpertos.com/index_windows7.html
14 years, 9 months
Re: [rules-users] NPE in RightTuple
by Hsiang, Eugene
Does anybody have any experience in resolving this:
Some background: I am trying to retract a fact and before doing that, I checked the object and make sure it is not null. But still, I got null pointer exceptions.
A previous developer working with me had posted the problem in Jan 2009. Apparently, there is no final answer in that thread. Here is the old thread: http://lists.jboss.org/pipermail/rules-users/2009-January/007555.html
This is my exception:
####<Mar 11, 2010 9:16:24 AM EST> <Error> <HTTP> <epsdatbeal25> <cla-01> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1268316984268> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@22fed98 - appName: 'cla', name: 'cla.war', context-path: '/cla-web'] Root cause of ServletException.
java.lang.NullPointerException
at org.drools.util.RightTupleIndexHashTable.remove(RightTupleIndexHashTable.java:224)
at org.drools.reteoo.JoinNode.retractRightTuple(JoinNode.java:204)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:210)
at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:190)
at org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1078)
at org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1045)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
at $Proxy42.retract(Unknown Source)
Thank you so much!
- Eugene
Eugene Hsiang
Application Architect
Reston Office
The College Board
11955 Democracy Drive
Reston, VA 20190-5662
571-485-3356 (office)
703-796-0817 (Fax)
ehsiang(a)collegeboard.org<mailto:ehsiang@collegeboard.org>
www.collegeboard.com
Connect to college success
14 years, 9 months
Overriding default evaluators
by Barry Kaplan
As part of my drools-scala project I am implementing evalators for scala
collections. This means that the some default evaluator operators like
"contains" and "memberOf" need to be overridden. My problem is that drools
seems to load the evaluators as defined in meta-infa/(I forget the file
name) in an arbitrary manner. This results in my scala evaluator getting
registered and then the default evaluator getting registered, overriding the
scala evaluator.
Has this variant of extensibility been considered -- not adding evaluators
as that works great -- but overriding a drools implementation? If not, I'll
have to do some internals hacking.
-bk
--
View this message in context: http://n3.nabble.com/Overriding-default-evaluators-tp441342p441342.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Question on contains operator with integer
by cwolfinger
Hello - I have a question on how to a contains operation with primitive
values. What I have is a message that has a field called intTest that is a
List<Integer>. If i do an intTest contains 4 check, then check compiles but
it never matches. However if I do an eval it does work. Does anyone know
how to use a primitive in a contains.
Here is a sample of the rule:
package com.sample
import com.sample.DroolsTest.Message;
rule "Test" salience 9999
#when Message( eval(intTest.contains(Integer.valueOf(4))))
when Message( intTest contains 4)
then
System.out.println("Found 4");
end
--
View this message in context: http://n3.nabble.com/Question-on-contains-operator-with-integer-tp440559p...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months