風人園

          弱水三千,只取一瓢,便能解渴;佛法無邊,奉行一法,便能得益。
          隨筆 - 99, 文章 - 181, 評論 - 56, 引用 - 0
          數據加載中……

          jBPM之Custom node behaviour

          在流程中會涉及到很多的分支結構,下面就用代碼說明
          public?class?AmountUpdate?implements?ActionHandler?{
          ??
          public?void?execute(ExecutionContext?ctx)?throws?Exception?{
          ????
          //?business?logic
          ????Float?erpAmount?=?get?amount?from?erp-system;
          ????Float?processAmount?
          =?(Float)?ctx.getContextInstance().getVariable("amount");
          ????
          float?result?=?erpAmount.floatValue()?+?processAmount.floatValue();
          ????update?erp
          -system?with?the?result;
          ????
          ????
          //?graph?execution?propagation
          ????if?(result?>?5000)?{
          ??????ctx.leaveNode(ctx,?
          "big?amounts");
          ????}
          ?else?{
          ??????ctx.leaveNode(ctx,?
          "small?amounts");
          ????}

          ??}

          }
          leaveNode(java.lang.String?transitionName)
          ??????????leave this node over the given transition.
          通過ctx的 leaveNode方法,來確定下一個node,這樣就可以通過代碼動態控制流程。

          posted on 2007-01-18 14:18 風人園 閱讀(520) 評論(0)  編輯  收藏 所屬分類: jBPM

          主站蜘蛛池模板: 磐石市| 剑阁县| 娱乐| 泸水县| 耒阳市| 峡江县| 黑河市| 茶陵县| 洛扎县| 锡林郭勒盟| 威宁| 新泰市| 吉首市| 周至县| 武山县| 乌拉特中旗| 苍南县| 蛟河市| 湘乡市| 潼南县| 肇庆市| 武汉市| 无锡市| 赣州市| 哈尔滨市| 菏泽市| 红桥区| 台江县| 邹城市| 通河县| 叶城县| 迭部县| 蒙阴县| 前郭尔| 台州市| 凤翔县| 青龙| 诏安县| 昂仁县| 保德县| 建平县|