SAP Cloud Platform integration上创建一个最简单的iFlow
登錄SAP CPI控制臺,點擊這個鉛筆圖標進入工作區域:
選擇一個已經存在的content package:
在這個content package里創建一個新的iFlow:
默認生成的iFlow模型如下。刪除Sender,因為在這個最簡單的iFlow里,我們采用timer方式觸發:
刪除Sender后如下圖所示:
選擇一個Timer作為iFlow觸發器:
將tinmer拖拽到integration process區域,選擇Scheduler屬性,設置成Run Once-運行一次。
再拖拽一個Content Modifier到integration process區域,切換到message body,維護一個Hello World:
將start timer同content modifier連接起來:
添加一個groovy script:
點擊script步驟的create標簽:
本地新建一個文本文件,將下列groovy代碼粘貼進去,另存為test.groovy:
import com.sap.gateway.ip.core.customdev.util.Message; import java.util.HashMap; def Message processData(Message message) { def body = message.getBody(java.lang.String) as String; def messageLog = messageLogFactory.getMessageLog(message); if(messageLog != null) { messageLog.addAttachmentAsString("Log current Payload:", body, "text/plain"); } return message; }將本地groovy文件上傳到script步驟里:
再將Content modifier同Groovy Script連接起來,最近進行部署。
部署成功后,到operation視圖查看剛剛部署的iFlow的執行情況。點擊tile “All Integration Flows”:
狀態:成功執行
在attachment區域能看到之前用groovy script存儲的附件:
messageLog.addAttachmentAsString(“Log current Payload:”, body, “text/plain”);
這個最簡單的iFlow展示到此就成功了:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的SAP Cloud Platform integration上创建一个最简单的iFlow的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LOL9.18版本船长怎么出装 船长天赋
- 下一篇: 如何给腾讯云域名申请免费的SSL证书