The Solicitud object has sumaMontoLCG and sumaMontoGarantia atts as
int (primitives).
Im using 3.0.6 and java 1.5
I have this simple rule:
rule "montos maximos y minimos"
salience 888
when
a: Actor(tipo :tipoActor == Actor.JefeOficina, max: limiteMaximo,
min: limiteMinimo)
s: Solicitud( sumaLCG: sumaMontoLCG < max, sumaGTIA:
sumaMontoGarantia -> ( (sumaLCG.intValue() - sumaGTIA.intValue()) <
min.intValue()) )
then
System.out.println("Suma LCG:"+sumaLCG);
System.out.println("Actor lim max:"+max);
System.out.println("Actor tipo:"+tipo);
end
Fire the rule shows me this error:
org.drools.RuntimeDroolsException:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.rule.PredicateConstraint.isAllowed(Unknown Source)
at org.drools.common.BetaNodeBinder.isAllowed(Unknown Source)
at org.drools.reteoo.TupleSource.attemptJoin(Unknown Source)
at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple
(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at
cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.fireRulesSOLCRED
(SolcredRulesPoC.java:85)
at cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.main
(SolcredRulesPoC.java:40)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.reteoo.FactHandleList.get(Unknown Source)
at org.drools.reteoo.TupleKey.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at
cl.bluesoft.jbrules.rules.solcred.Rule_montos_maximos_y_minimos_0Predica
te0Invoker.evaluate
(Rule_montos_maximos_y_minimos_0Predicate0Invoker.java:14)
... 17 more
When I change the column to:
s: Solicitud( sumaLCG: sumaMontoLCG < max, sumaGTIA:
sumaMontoGarantia -> ( (sumaLCG - sumaGTIA) < min) )
its shows this error:
org.drools.rule.InvalidRulePackage: Rule Compilation error The
operator - is undefined for the argument type(s) java.lang.Integer,
java.lang.Integer
at org.drools.rule.Package.checkValidity(Unknown Source)
at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
at cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.readRule
(SolcredRulesPoC.java:60)
at cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.main
(SolcredRulesPoC.java:36)
This happens in a predicate or in a value expression, so I cant use
this formula... What is wrong?
Thx.
Felipe Piccolini M.
felipe.piccolini(a)bluesoft.cl