Junky's IT Notebook

          統計

          留言簿(8)

          積分與排名

          WebSphere Studio

          閱讀排行榜

          評論排行榜

          Work Flow 學習筆記

          ??????????????? ???? Work Flow 學習筆記

          1.??? WfRequester

          WfRequester is the interface that has a direct concern with the execution and results

          of a workflow process - it represents the request for some work to be done. Its

          performer, a WfProcess, is expected to handle its request and communicate significant

          status changes; in particular to inform the requester when it has completed performing

          the requested work. A single requester can have many processes associated with it.

          ?
          ??
          ?
          ?

          說明: WfRequester 接口是一個和工作流流程的執行及結果有直接關系的接口;它代表了對一些工作執行的請求;它的一個主要功能是把 WfProcess 鏈接到一個其它應用;其中 WfRequester 會關聯到多個 WfProcee, WfProcess 發生 complete terminate abort 事件時會通過回調 receiveEvent() 方法來通知 WfRequest ;在 receiveEvent(event) 方法中,參數 event 是一個 WfEventAudit 對象,其中 WfEventAudit 中有一個方法 source(), 通過這個方法我們可以得知是哪個 WfExecutionObject 對象觸發了事件源;得到了 WfExcutionObject WfProcess 我們也進而 得到了和這個 WfProcess 相關聯的其它應用;

          主要步驟 :

          (1)??? 自定義一個自己的類或接口,如 GenericRequester, 這個 GenericRequester 類代表用戶自定義的一個請求者;

          (2)??? 在啟動 WfProcess 是,把這個請求者和 WfProcess 進行綁定注冊到 WfRequester 中;

          ?

          WfReuester registerProcess() 就是做這個功能,主要代碼如下

          protected Map performers = null;

          public void registerProcess(WfProcess process, Map context, GenericRequester requester){

          ?????????????? performers.put(process, requester);

          ?

          }

          (3)??? 當工作流程在執行的過程中發生 complete terminate abort 事件時會回調 WfRequest 中的 receiveEvent() 方法:

          ??? ? requester.receiveEvent(audit);

          (4) ?? receiveEvent() 中首先根據 WfEventAudit source() 獲取觸發事件的 WfProcess 對象;

          receiveEvent(WfEventAudit event){

          ??????? // 獲取事件源 process 對象

          WfProcess? process = (WfProcess) event.source();

          // 根據 prcocess 對象獲取在注冊時綁定的自定義請求者 GenericRequester

          GenericRequester ?req = (GenericRequester) performers.get(process);

          // 執行自定義請求者的方法

          req.receiveResult(process.result());

          }

          其它:在這里 GenericRequester 也可是一個 WfProcess WfActivity 對象,這樣可以在 WfProcess 完成操作后又啟動另一個子流程或某個活動; ???

          posted on 2006-05-25 20:23 junky 閱讀(354) 評論(0)  編輯  收藏 所屬分類: Work Flow


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 嵊州市| 乳源| 鹤壁市| 始兴县| 托里县| 太仓市| 满洲里市| 京山县| 禹州市| 四子王旗| 新沂市| 松桃| 板桥市| 安顺市| 吉首市| 大石桥市| 佛学| 兴仁县| 浮梁县| 新疆| 沈阳市| 大邑县| 北宁市| 南澳县| 喀喇| 调兵山市| 屏山县| 庆城县| 南涧| 隆化县| 嘉定区| 调兵山市| 济源市| 乐山市| 桐梓县| 松滋市| 黄浦区| 邯郸市| 沾益县| 安仁县| 山西省|