Fork me on GitHub

Urule开源版系列2——console的常用接口

1. 创建决策表接口:

http://localhost:8080/urule/frame/createFile post

  • FrameServletHandler.createFile 方法

参数:

  • path: /demo/测试/决策表1.dt.xml
  • type: dt.xml

2. 保存决策文件

http://localhost:8080/urule/common/saveFile post

  • CommonServletHandler.saveFile

参数:

  • content: xml <?xml version="1.0" encoding="utf-8"?><parameter-library><parameter name='age' label='年龄' type='Integer' act='InOut'/></parameter-library>
  • file: /demo/测试/参数1.pl.xml
  • newVersion: false

3. 测试规则

http://localhost:8080/urule/packageeditor/doTest post

  • PackageServletHandler.doTest

参数:

  • files: jcr:/demo/测试/规则1.rs.xml,LATEST;jcr:/demo/测试/决策表1.dt.xml,LATEST
  • data: [{"name":"标签","clazz":"cn.infisa.tools.km.model.Tag","variables":[{"name":"id","label":"数据库ID","type":"Long","_editorType":"number","id":"_ui_205"},{"name":"name","label":"姓名","type":"String","defaultValue":"abc","_editorType":"string","id":"_ui_206"},{"name":"seq","label":"排序","type":"Integer","_editorType":"number","id":"_ui_207"},{"name":"source","label":"来源","type":"String","defaultValue":"1111","_editorType":"string","id":"_ui_208"},{"name":"type","label":"标签类型","type":"String","_editorType":"string","id":"_ui_209"},{"name":"uuid","label":"标签逻辑ID","type":"String","_editorType":"string","id":"_ui_210"},{"name":"value","label":"标签值","type":"String","defaultValue":"abc","_editorType":"string","id":"_ui_211"}],"id":"_ui_195"},{"name":"参数","clazz":"java.util.HashMap","variables":[{"name":"age","label":"年龄","type":"Integer","defaultValue":"1122","_editorType":"number","id":"_ui_243"}],"id":"_ui_196"}]

附录-决策表支持类型

类型 英文 文件后缀 编辑器
决策集 Ruleset rs.xml ruleseteditor
决策表 DecisionTable dt.xml decisiontableeditor
脚本式决策表 ScriptDecisionTable dts.xml
动作库 ActionLibrary al.xml actioneditor
变量库 VariableLibrary vl.xml variableeditor
参数库 ParameterLibrary pl.xml parameterditor
常量库 ConstantLibrary cl.xml constanteditor
决策流 RuleFlow rl.xml ruleflowdesigner
脚本规则 UL .ul uleditor
决策树 DecisionTree dtree.xml decisiontreeeditor
评分卡 Scorecard sc scorecardeditor
虚拟目录 DIR DIR
知识包 packageeditor

posted @   龙城飞将军  阅读(1682)  评论(0编辑  收藏  举报
编辑推荐:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· DeepSeek 解答了困扰我五年的技术问题
阅读排行:
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 推荐几款开源且免费的 .NET MAUI 组件库
· 实操Deepseek接入个人知识库
· 易语言 —— 开山篇
· 【全网最全教程】使用最强DeepSeekR1+联网的火山引擎,没有生成长度限制,DeepSeek本体
点击右上角即可分享
微信分享提示