youseries / urule

URULE是一款基于RETE算法的纯Java规则引擎,提供规则集、决策表、决策树、评分卡,规则流等各种规则表现工具及基于网页的可视化设计器,可快速开发出各种复杂业务规则。
Apache License 2.0
1.83k stars 723 forks source link

仿真测试double类型的字段,两个字段做减法运算报错 用去掉空格函数正常运行 #38

Closed mataoshishen closed 6 years ago

mataoshishen commented 6 years ago

为了您的问题能得到及时准确解答,请认真填写下面各个选项,感谢您的配合。

2.13

仿真测试double类型的字段,两个字段做减法运算报错 用去掉空格函数正常运行

image image

youseries commented 6 years ago

完整异常发上来!

mataoshishen commented 6 years ago

就是多空格,程序里面没有去空格

Caused by: java.lang.NumberFormatException: Can not convert 20.0 to number. at com.bstek.urule.Utils.toBigDecimal(Utils.java:168) at com.bstek.urule.runtime.ElCalculator.calculate(ElCalculator.java:192) at com.bstek.urule.runtime.ElCalculator.calculate(ElCalculator.java:90) at com.bstek.urule.runtime.ElCalculator.eval(ElCalculator.java:32) at com.bstek.urule.runtime.rete.ContextImpl.parseExpression(ContextImpl.java:66) at com.bstek.urule.runtime.rete.ValueCompute.compute(ValueCompute.java:102) at com.bstek.urule.runtime.rete.ValueCompute.complexValueCompute(ValueCompute.java:56) at com.bstek.urule.action.VariableAssignAction.execute(VariableAssignAction.java:55) at com.bstek.urule.runtime.agenda.ActivationImpl.execute(ActivationImpl.java:99) at com.bstek.urule.runtime.agenda.ActivationRuleBox.execute(ActivationRuleBox.java:47) at com.bstek.urule.runtime.agenda.Agenda.execute(Agenda.java:53) at com.bstek.urule.runtime.KnowledgeSessionImpl.execute(KnowledgeSessionImpl.java:207) at com.bstek.urule.runtime.KnowledgeSessionImpl.fireRules(KnowledgeSessionImpl.java:137) at com.bstek.urule.console.servlet.respackage.PackageServletHandler.doTest(PackageServletHandler.java:685) ... 67 more

youseries commented 6 years ago

最新版SNAPSHOT中已做去空格处理,谢谢。

mataoshishen commented 6 years ago

什么时间发布呢