浏览 1965 次
锁定老帖子 主题:jbpm的例子之四 使用decision
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-06-09
最后修改:2009-09-17
<?xml version="1.0" encoding="UTF-8"?> <process-definition name="testDecision"> <start-state name="s"> <transition to="inputScore" /> </start-state> <state name="inputScore"> <script>System.out.println("The process is at "+node);</script> <transition to="decision1" /> </state> <decision name="decision1"> <handler class="test.decision.ScoreDecisionHandler" /> <transition name="t1" to="s1" /> <transition name="t2" to="s2" /> </decision> <node name="s1"> <script> System.out.println("The process is at "+node); token.signal(); </script> <transition name="" to="End" /> </node> <node name="s2"> <script> System.out.println("The process is at "+node); token.signal(); </script> <transition name="" to="End" /> </node> <end-state name="End"></end-state> </process-definition> public class ScoreDecisionHandler implements DecisionHandler { private static final long serialVersionUID = 1L; @Override public String decide(ExecutionContext executionContext) throws Exception { int score = (Integer) executionContext.getVariable("score"); if (score < 50) return "t1"; return "t2"; } } 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |