[rules-users] rule validates in guvnor but errors when running

kurrent93 kurrent93 at gmail.com
Thu Jan 17 20:00:56 EST 2013


Hi

I'm trying to understand what is wrong with this rule. It validates in
guvnor, but when running it throws an error.

I am trying to write a rule that will fire if there have been less than ten
trades in ten minutes.

This is the rule:
1.	|	rule "Trade Count"
2.	|	    dialect "mvel"
3.	|	    when
4.	|	        Number( trades : intValue < 10 )
5.	|	         from accumulate(
6.	|	         e: TradeOrder( )
7.	|	         over window:size(10m),
8.	|	         count(e) )
9.	|	    then
10.	|	        TradeOrder silverTrade = new TradeOrder();
11.	|	        silverTrade.setMt4username( "4002642" );
12.	|	        silverTrade.setOperation( "OP_BUY" );
13.	|	        silverTrade.setStatus( OrderStatus.OPENING );
14.	|	        silverTrade.setSymbol( "SILVER" );
15.	|	        silverTrade.setVolume( 1 );
16.	|	        silverTrade.setOrderLots( 2 );
17.	|	        insert( silverTrade );
18.	|	        
19.	|	        
20.	|	        modifiedOrderList.add(silverTrade);
21.	|	end

What I assume to be the relevant portion of the stack trace is here:
Caused by: java.lang.NoSuchMethodError:
org.mvel2.compiler.CompiledExpression.getParserConfiguration()Lorg/mvel2/ParserConfiguration;
	at
org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:207)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:651)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:590)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:350)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:355)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
	at
org.switchyard.component.rules.exchange.drools.DroolsRulesExchangeHandler.handleMessage(DroolsRulesExchangeHandler.java:280)
[switchyard-component-rules-0.6.0-SNAPSHOT.jar:0.6.0-SNAPSHOT]
	at
org.switchyard.bus.camel.ProviderProcessor.process(CamelExchangeBus.java:216)
	at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
[camel-core-2.10.0.jar:2.10.0]
	... 153 more



--
View this message in context: http://drools.46999.n3.nabble.com/rule-validates-in-guvnor-but-errors-when-running-tp4021635.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list