Total Pageviews

2017/05/07

[webMethods] 在 Flow Service 中使用 Sequence 來實現 try-catch

步驟 1. 建立一個 SequenceFlow,並建立兩個輸入參數 num1 與 num2,將 num1 * num2 的結果傳送到輸出參數 result


步驟 2. 建立三個 Sequences,try-catch, try 與 catch,此三個 sequence 的 Exit on 參數分別為
* ‘Success’ for the ‘try-catch’ sequence.
* ’Failure’ for the ‘try’ sequence.
* ‘Done’ for the catch sequence.


步驟 3. 在 try-sequence 中加入 multiplyInts 進行運算


步驟 4. 在 catch-sequence 中加入 getLastError 來取得例外錯誤訊息,並加入 debugLog 將錯誤訊息印到 server log


步驟 5. 執行並驗證結果

No comments: