[rules-users] From accumulate compilation error :java.Math.BigDecimal cannot be resolved to a type

Kris Verlaenen kris.verlaenen at cs.kuleuven.be
Fri Nov 16 10:58:21 EST 2007


Have you tried java.math (math should not be capitalized)?

Kris

----- Original Message ----- 
From: "Andy Mei" <andy.d.mei at gmail.com>
To: <rules-users at lists.jboss.org>
Sent: Friday, November 16, 2007 4:44 PM
Subject: [rules-users] From accumulate compilation error 
:java.Math.BigDecimal cannot be resolved to a type


> Hi,
>
>  I am getting compilation error when I tried to use
> java.Math.BigDecimal object within from accumulate clause.  I am not
> sure why Drools does not regonize full qualify namespaces for
> BigDecimal.
>
>  Here is my LHS:
>
>>$netDailyPnl : Number ( )
>> from accumulate ( Position ( secId == $pos.secId, $baseRealizedPnl :
> baseRealizedPnl, $baseUnrealizedPnl : baseUnrealizedPnl ),
>> init ( java.Math.BigDecimal netDailyPnl = new java.Math.BigDecimal ( 
>> 0 ); ),
>> action ( netDailyPnl.add($baseRealizedPnl);
> netDailyPnl.add($baseUnrealizedPnl); ),
>> reverse ( ),
>> result ( netDailyPnl )
>>       )
>
>  Here is compilation log:
>
> Caused by: org.drools.compiler.DroolsParserException: Rule Compilation
> error : [Rule name=Extreme Single Position (TID) PL Movement,
> agendaGroup=MAIN, salience=43, no-loop=false]
> com/trg/pnl/Rule_Extreme_Single_Position__TID__PL_Movement_0.java
> (12:370) : java.Math.BigDecimal cannot be resolved to a type
> com/trg/pnl/Rule_Extreme_Single_Position__TID__PL_Movement_0.java
> (21:557) : netDailyPnl cannot be resolved
> com/trg/pnl/Rule_Extreme_Single_Position__TID__PL_Movement_0.java
> (21:575) : java.Math.BigDecimal cannot be resolved to a type
> com/trg/pnl/Rule_Extreme_Single_Position__TID__PL_Movement_0.java
> (31:1030) : netDailyPnl cannot be resolved
> com/trg/pnl/Rule_Extreme_Single_Position__TID__PL_Movement_0.java
> (31:1065) : netDailyPnl cannot be resolved
> com/trg/pnl/Rule_Extreme_Single_Position__TID__PL_Movement_0.java
> (47:1667) : netDailyPnl cannot be resolved
>
> at 
> com.trg.ruleengine.util.RuleBaseBuilder.readRule(RuleBaseBuilder.java:104)
> at 
> com.trg.ruleengine.impl.DroolsRuleEngineBuilder.getRuleBase(DroolsRuleEngineBuilder.java:109)
> ... 10 more
>
>  Thanks!
>
> Andy
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users 




More information about the rules-users mailing list