The Eclipse JDT Core jar is not in the classpath error
by Chris Richmond
Hello,
I am using netbeans and ivy with Drools 5. I have successfully named,
published the jars from drools to and could build my port of the stock
ticker application in netbeans, but when I try to run it, I get the
following error:
java.lang.NoClassDefFoundError: org/antlr/runtime/tree/TreeNodeStream
I have the antlr-runtime jar from the bin/lib on my classpath where I added
all the others, but it always fails at this line
In loadRuleBase() in Broker.java of the stock ticker sample
builder.add( ResourceFactory.newInputStreamResource(
Broker.class.getResourceAsStream( RULES_FILE ) ),
ResourceType.DRL);.
Does anyone have any ideas what jar I might be missing if it's not the
antlr-runtime?
Thanks,
Chris
17 years, 1 month
FW: Nested flow terminating parent flow prematurely
by Tom.E.Murphy@wellsfargo.com
Thanks to Travis Scheponik for trying to help me resolve this. However, neither he nor I could figure it out.
Babak solved it here at the boot camp - the subprocesses should have their end nodes with terminate set to TRUE not false, and the parent process should invoke the subprocess with WaitForCompletion set to true.
This was the one combination we had not tried, and it worked.
Thanks, Babak.
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
_____________________________________________
From: Murphy, Tom E.
Sent: Thursday, May 28, 2009 8:54 AM
To: 'rules-users(a)lists.jboss.org'
Subject: Nested flow terminating parent flow prematurely
Hi.
I'm struggling with a rule flow that contains another rule flow.
Rule flow 1 - first step is to invoke a sub-process, call it rule flow 2.
Rule flow 2 executes fine, with correct internal branching logic.
Rule flow 2 proceeds to an End object with terminates set to false.
After RF2 completes, I am expecting a return to the parent flow, RF1.
However, entire flow terminates and subsequent RF Groups and or RF's in parent flow are never activated.
Is this a bug or am I specifying something incorrectly?
Using Version 5.0.0.CR1
Code for the two flows is below (excuse the ugly ID's and names - these are generated from our rule repository software):
<!-- TOP / OUTERMOST FLOW: -->
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://drools.org/drools-5.0/process"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd<http://drools.org/drools-5.0/process%20drools-processes-5.0.xsd>"
type="RuleFlow" name="RF6677: R3.09 GAIP" id="29405" package-name="com.wellsfargo.GeneratedRules" version="2" >
<header>
<imports>
<import name="com.wellsfargo.service.provider.hcfg.entity.workingObjects.x2007.PolicySet" />
</imports>
</header>
<nodes>
<start id="1" name="Start" x="105" y="108" width="48" height="48" />
<join id="3" name="EndJoin" x="500" y="500" type="3" />
<end id="4" name="End" x="600" y="600" terminate="false" />
<subProcess id="29403" name="R3.09 GAIP REP 3" x="400" y="400" processId="29403" >
</subProcess>
<ruleSet id="50000580" name="50000580" x="300" y="300" ruleFlowGroup="RF6677_50000580" />
<subProcess id="29364" name="R3.09 GAIP REP 1" x="200" y="200" processId="29364" >
</subProcess>
<split id="150000579" x="458" y="205" width="48" height="48" type="2" >
<constraints>
<constraint toNodeId="50000580" toType="DROOLS_DEFAULT" name="constraint" priority="1" type="rule" dialect="mvel" >PolicySet ( serviceFlowCode == "GAIP" )</constraint>
<constraint toNodeId="3" toType="DROOLS_DEFAULT" name="constraint" priority="1" type="rule" dialect="mvel" >PolicySet ( serviceFlowCode == "Post Rules Processing" )</constraint>
</constraints>
</split>
</nodes>
<connections>
<connection from="29403" to="3" />
<connection from="150000579" to="3" />
<connection from="3" to="4" />
<connection from="50000580" to="29403" />
<connection from="150000579" to="50000580" />
<connection from="1" to="29364" />
<connection from="29364" to="150000579" />
</connections>
</process>
<!-- FIRST INNER FLOW - subProcess id="29403" -->
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://drools.org/drools-5.0/process"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd<http://drools.org/drools-5.0/process%20drools-processes-5.0.xsd>"
type="RuleFlow" name="RF6662: R3.09 GAIP REP 1" id="29364" package-name="com.wellsfargo.GeneratedRules" version="2" >
<header>
<imports>
<import name="com.wellsfargo.service.provider.hcfg.entity.decision.x2007.RiskDecisionResultEnum" />
<import name="com.wellsfargo.service.provider.hcfg.document.loanFile.x2007.TransactionDecisionResults" />
</imports>
</header>
<nodes>
<start id="1" name="Start" x="405" y="12" width="48" height="48" />
<join id="250000560" x="661" y="351" width="48" height="48" type="3" />
<ruleSet id="50000554" name="50000554" x="390" y="109" width="80" height="48" ruleFlowGroup="RF6662_50000554" />
<ruleSet id="50000555" name="50000555" x="388" y="231" width="80" height="48" ruleFlowGroup="RF6662_50000555" />
<end id="3" name="End" x="682" y="754" width="48" height="48" terminate="false" />
<ruleSet id="50000556" name="50000556" x="137" y="349" width="80" height="48" ruleFlowGroup="RF6662_50000556" />
<ruleSet id="50000557" name="50000557" x="137" y="510" width="80" height="48" ruleFlowGroup="RF6662_50000557" />
<ruleSet id="50000558" name="50000558" x="253" y="506" width="80" height="48" ruleFlowGroup="RF6662_50000558" />
<ruleSet id="50000584" name="50000584" x="552" y="501" width="80" height="48" ruleFlowGroup="RF6662_50000584" />
<ruleSet id="50000559" name="50000559" x="403" y="505" width="80" height="48" ruleFlowGroup="RF6662_50000559" />
<split id="150000555" x="404" y="351" width="48" height="48" type="2" >
<constraints>
<constraint toNodeId="250000560" toType="DROOLS_DEFAULT" name="constraint" priority="1" type="rule" dialect="mvel" >TransactionDecisionResults ( riskDecisionResult == RiskDecisionResultEnum.NO_DECISION )</constraint>
<constraint toNodeId="50000556" toType="DROOLS_DEFAULT" name="constraint" priority="1" type="rule" dialect="mvel" >TransactionDecisionResults ( riskDecisionResult != RiskDecisionResultEnum.NO_DECISION )</constraint>
</constraints>
</split>
<ruleSet id="50000560" name="50000560" x="650" y="595" width="80" height="48" ruleFlowGroup="RF6662_50000560" />
</nodes>
<connections>
<connection from="50000584" to="250000560" />
<connection from="150000555" to="250000560" />
<connection from="1" to="50000554" />
<connection from="50000554" to="50000555" />
<connection from="50000560" to="3" />
<connection from="150000555" to="50000556" />
<connection from="50000556" to="50000557" />
<connection from="50000557" to="50000558" />
<connection from="50000559" to="50000584" />
<connection from="50000558" to="50000559" />
<connection from="50000555" to="150000555" />
<connection from="250000560" to="50000560" />
</connections>
</process>
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
17 years, 1 month
String comparison question
by Armaghan Mahmud
Hey guys,
I read in a previous post that == in Drools 4.0.7 maps to .equals()
automatically. My situation required me to put a String object into the
working memory and do a comparison on it to see if a particular word is in
the passed String sentence. Could anybody please guide me as to how to
approach this problem? Thanks in advance. Here's my original code:
rule "Find Alpha in a sentence"
*
salience* 100
wrap: WrapperClass(Sentence == "Alpha")
then
System.out.*println*("Aha found ya!");
end
17 years, 1 month
rule using sliding window
by Bhushan Bhangale
I am using Drools 5. I am struggling to write rule for this logic -
If a stock price changes more than 10% within an hour then report the
change.
I understand I have to use sliding window feature but unable to write the
rule.
For example I got an update for IBM stock @ 12:30 for price 100 and then
another update IBM stock @ 12:35 for price 111. Since the time difference is
within an hour and the change is also greater than 10% I want to report this
price change.
Stock class -
Public class Stock {
Private String stock;
Private double price;
Private Date time;
Private double priceChange;
Private Boolean highlight;
}
rule "Stock Price change more than 10% within an hour"
when
then
set the priceChange attribute of Stock object
set highlight to true
end
Secondly if the window is large and number of records coming in is high then
could there be a memory issue?
Also since every record is getting stored in database, can I not use the
database directly instead of sliding window?
Thanks
Mr. Bhangale Bhushan
Associate Manager
Kale Consultants Ltd.
<mailto:bhushan_bhangale@kaleconsultants.com>
bhushan_bhangale(a)kaleconsultants.com
tel:
<http://www.plaxo.com/click_to_call?lang=en&src=jj_signature&To=%2B91+%280%2
9206+608+3777&Email=bhushan_bhangale(a)kaleconsultants.com> +91 (0)206 608
3777
<http://www.kaleconsultants.com> http://www.kaleconsultants.com
Disclaimer: This email (including any attachments) is intended for the sole
use of the recipient/s and may contain material that is CONFIDENTIAL. Any
unauthorized disclosure / copying / distribution or forwarding of this message
or part is STRICTLY PROHIBITED. If you have erroneously received this message,
please delete it immediately and notify the sender. No liability is assumed for
any errors and/or omissions in the contents of this message. Information in
this message that does not relate to the official business of this Company
shall be understood as neither given nor endorsed by it. If verification is
required please request a hard-copy version.
To know more about Kale Consultants, visit www.kaleconsultants.com
-=-=-=-=-=-=-=-=-=-
17 years, 1 month
drools filtering
by jayadevan.m@gmail.com
HI all
I want to applay filter codition on a list , that was generated in d
rules .For example first statement applay one filter condtion on one entity
list, then I want to filter the result . is it possible in drools ?
thanks and regards
17 years, 1 month
Clarification regarding the use of Guvnor
by Andrew Nguyen
Hello all,
I am a very new Drools user and am trying to expose it as a web-
service. Due to my experience with Spring, I went ahead and
implemented a basic rule engine and exposed it as a web service via
Spring. I am now looking at integrating it with Guvnor to allow non-
computer people, who are domain experts, to modify the rules. From
what I have read in the v5 documentation, it sounds like Guvnor is
intended as a complete solution to what I am trying to accomplish -
i.e. it will handle the rule management as well as exposing the rule
engine via JSON (or other interface). But, when I have searched
around the internet, Guvnor sounds like just a rule management
component.
So, I pretty much have 3 questions:
* Is my current setup of Drools + Spring the best way to expose my
rule engine to other applications? (Specifically, a .NET/C# app...)
* Is Guvnor suitable for integrating into my system as only a rule
management system?
Thanks!
--Andrew
--
Andrew Nguyen
Nguyen & Associates
Custom Software Development & IT Services
http://www.na-consulting.net
andrew(a)na-consulting.net
858-225-7575
17 years, 1 month
Re: [rules-users] String comparison question
by Greg Barton
Try a comma instead of &&
WrapperClass( sentence matches ".*Alpha.*", sentence2 matches ".*Beta*.")
--- On Mon, 6/1/09, Armaghan Mahmud <mahmud.armaghan(a)gmail.com> wrote:
> From: Armaghan Mahmud <mahmud.armaghan(a)gmail.com>
> Subject: Re: [rules-users] String comparison question
> To: "Rules Users List" <rules-users(a)lists.jboss.org>
> Date: Monday, June 1, 2009, 11:12 AM
> Thanks for your reply Edson. What
> if I want to test for multiple substrings in different
> strings?
>
> For example, how can I find beta in sentence2?
>
> I tried to combine WrapperClass( sentence matches
> ".*Alpha.*" && sentence2 matches
> ".*Beta*.") but I got errors.
>
> Thanks,
> Armaghan
>
> 2009/5/31 Edson Tirelli <tirelli(a)post.com>
>
>
> If the string you are looking for is a substring of
> your sentence, you need to either use a regexp or an eval to
> call for an indexOf-like method:
>
>
> WrapperClass( sentence matches ".*Alpha.*" )
>
> []s
> Edson
>
>
> 2009/5/31 Armaghan Mahmud <mahmud.armaghan(a)gmail.com>
>
>
>
>
>
> Hey guys,
>
> I read in a previous post that == in Drools 4.0.7 maps
> to .equals() automatically. My situation required me to put
> a String object into the working memory and do a comparison
> on it to see if a particular word is in the passed String
> sentence. Could anybody please guide me as to how to
> approach this problem? Thanks in advance. Here's my
> original code:
>
>
>
> rule "Find Alpha in a
> sentence"
> salience100
> wrap: WrapperClass(Sentence == "Alpha")
> then
> System.out.println("Aha found
> ya!");
> end
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> JBoss, a division of Red Hat @ www.jboss.com
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
17 years, 1 month
ClassCastException for Hibernate entity when rule is fired
by Sobhana
hi, can someone please help with the below issue? Any tips or hints on what
could be causing this would be very helpful.
We are using Drools 4.0.7 and have a rule which uses a Hibernate entity
(SaleEventItem) and its related entity (Inventory). Some times, the
SaleEventItem passed as the fact has the Inventory lazy loaded and hence its
type is the Hibernate proxy - Inventory_$$_javassist_93. In this case, the
rule runs fine.
But at times, the SaleEventItem which is passed has the Inventory attribute
set explicitly and hence its type is Inventory itself. When the rule fires
in this case, it tries to assign the Inventory into
Inventory_$$_javassist_93 which causes this ClassCastException.
java.lang.ClassCastException: com.crom.data.pojo.Inventory incompatible with
com.crom.data.pojo.Inventory_$$_javassist_93
at ASMAccessorImpl_14985690421242774005070.getValue(Unknown Source)
at
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
at
org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
at
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
How do we prevent this? Is it possible to somehow enforce that the type of
the variable in the rule should be Inventory and not
Inventory_$$_javassist_93?
The rule is as follows.
dialect "java"
when
$sale:SaleEventItem(inventory != null,
$leaseInfo:inventory.leaseInformation != null,
$saleEventPrize:inventory.leaseInformation.residualPayAmount != null)
then
$sale.setStartPrice((Double)$sale.getInventory().getLeaseInformation().getResidualPayAmount());
Thanks,
Sobhana
--
View this message in context: http://www.nabble.com/ClassCastException-for-Hibernate-entity-when-rule-i...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month