如何以编程方式更改预定义的Drools Flow流程?

时间:2012-03-29 08:50:18

标签: java drools

最简单的情况:我有流口水。 很简单,比如

"<?xml version="1.0" encoding="UTF-8"?> 
<process xmlns="http://drools.org/drools-5.0/process"
         xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
         xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
         type="RuleFlow" name="ruleflow" id="com.sample.ruleflow" package-name="com.sample" >

  <header>
  </header>

  <nodes>
    <start id="1" name="Start" x="16" y="16" width="48" height="48" />
    <actionNode id="2" name="Hello" x="96" y="16" width="80" height="48" >
      <action type="expression" dialect="mvel" >System.out.println("Hello World");</action>
    </actionNode>
    <end id="3" name="End" x="208" y="16" width="48" height="48" />
  </nodes>

  <connections>
    <connection from="1" to="2" />
    <connection from="2" to="3" />
  </connections>

</process>"

如何以编程方式更改它,而不是将流文件加载到XML Parsers等,而是通过代码添加节点和连接?

提前致谢

1 个答案:

答案 0 :(得分:0)

我认为任何Drools API都不会用于修改规则