基于 beetl 的评级引擎 xml-eval

码农软件 · 软件分类 · 模板引擎 · 2019-08-22 19:27:52

软件介绍

一个使用 xml 和 beetl 来实现的计算引擎(评级引擎),支持树形评级结构,通过计算得出一个评级,可以用于打分等应用。

<?xml version="1.0" encoding="UTF-8"?>
<workspace name="评级">
    <project name="银行评级">
        <doc name="评级得分" f="sum">
            <node name="财务信息" f="sum">
                <node name="年度利润">每月收入*12</node>
                <node name="年度负债" >每月负债*12*0.3</node>
            </node>			
        </doc>
    </project>
</workspace>
<node name="非财务信息" f="sum">
            <node name="上访次数" f="script">
                <![CDATA[
                    var c =上访次数;
                    var d = 0;
                    if(c>10){
                        d=10;
                    }else{
                        d=100;
                    }
                    return d ;
        ]]>
    
    </node>
</node>
    EvalEngine engine = new EvalEngine();
    Map<String,Object> paras = new HashMap<String,Object>();
    paras.put("每月收入", 178832323.12);
    paras.put("每月负债", 128.99);
    InputStream ins = EvalEngineTest.class.getResourceAsStream("/sample/simple001.xml");
    InputStreamReader reader = new InputStreamReader(ins,"utf8");
    Object ret = engine.run(reader, paras);
    System.out.println(ret);

本文地址:https://www.codercto.com/soft/d/12946.html

Agile Web Application Development with Yii 1.1 and PHP5

Agile Web Application Development with Yii 1.1 and PHP5

Jeffrey Winesett / Packt Publishing / 2010-08-27

In order to understand the framework in the context of a real-world application, we need to build something that will more closely resemble the types of applications web developers actually have to bu......一起来看看 《Agile Web Application Development with Yii 1.1 and PHP5》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

SHA 加密
SHA 加密

SHA 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具