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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM