[rules-users] SPREADSHEET DECISION TABLE: Can I use functions into CONDITIONS?

Wolfgang Laun wolfgang.laun at gmail.com
Tue May 10 07:11:25 EDT 2011


Doesn't the dump show anything relating to isInRange or Utils.*?

Have you tried try/catch in isInRange, and printing its arguments?

-W


On 10 May 2011 12:08, zeta <zoraidahidalgo at gmail.com> wrote:
> Hi again! sorry for the delay, I have been out of the office. Thanks all for
> the answers. The function I tried to use on my spreadsheet was:
>
> function boolean isInRange(Date date, int months){
>        Date minDate = new Date();
>        Date maxDate = Utils.addMonthsToDate(minDate, months);
>        if((Utils.compareTo(minDate, date) == Utils.EQUAL ||
> Utils.compareTo(minDate, date) == Utils.LOWER) && (Utils.compareTo(maxDate,
> date) == Utils.EQUAL || Utils.compareTo(maxDate, date) == Utils.GREATER))
>            return true;
>        else return false;
>
>    }
>
> Utils is a static class I imported from my java classes. From the table
> rules:
> CONDITION
> customer:Customer()
> eval(isInRange(customer.setContractEndDate(),$param))
>
> And the trace:
>
> org.drools.RuntimeDroolsException: Exception executing predicate
> es.tid.tesco.ur.dataprocessing.ruleengine.rules.Rule_ContractDate_12_0Predicate0Invoker at 53028588
>        at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:279)
>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
>        at
> org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
>        at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
>        at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
>        at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
>        at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1174)
>        at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1123)
>        at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:917)
>        at
> org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
>        at
> org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:300)
>        at
> es.tid.tesco.ur.dataprocessing.ruleengine.impl.RuleEngineUpgradeImpl.execute(RuleEngineUpgradeImpl.java:64)
>        at ...
>
> Some suggestion? Thanks again.
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/SPREADSHEET-DECISION-TABLE-Can-I-use-functions-into-CONDITIONS-tp2899330p2922521.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> 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