跳至主要內容
Administrator Guide
上次更新時間 :2023-06-23
參照︰範例 Studio MVEL 運算式

參照︰範例 Studio MVEL 運算式

變數
範例運算式
說明
context
context.getProperty('myProperty')
擷取屬性值
myProperty
MediationContext
context.getProperty('someProperty').equals('someValue')
擷取屬性
someProperty
MediationContext
如果屬性值設為
someValue
da
da.toVar('eib_transform_output.txt', 'var1')
從檔案名為
eib_transform_output.txt
的整合事件中擷取文件,並新增名為「」的變數。
var1
da.getDocsMatching('label')
擷取具有指定標籤的文件。
ec
ec.getAttribute('attributeName')
擷取屬性內容名稱。
ec.integrationMapLookup('map', 'key')
擷取整合對應值。
env
env['cc.hostname']
擷取
cc.hostname
環境屬性設定為
-Dcc.hostname
在指令行中。
env.containsKey('key')
如果環境屬性包含指定的索引鍵,則顯示為 True。
ftp
ftp.list('URL')
擷取 URL 的檔案清單。
intsys
intsys.getAttribute('username')
擷取名為「」的整合屬性內容
username
intsys.isServiceEnabled('name')
如果具有指定名稱的整合服務存在,則顯示為 True。
lp
lp.getSimpleData('name')
擷取指定名稱的啟動參數值。
lp.exists('label') == true
如果具有指定標籤的參數存在,則顯示 True。
message
message.rootPartAsText
從以下位置以文字形式擷取訊息的根目錄部分︰
MediationMessage
介面
message.variables
擷取
MediationContext
變數
mtable
mtable['my_property'].set(0, 'Data_Column', 'my_test_data')
mtable
mtable['my_property'].get(0, 'Data_Column')
從以下項目擷取資料︰
mtable
parts
parts[0].getHeader('someHeader')
擷取標頭
someHeader
從根部聲部
parts[0].xpathB('/a/b')
實作
xpathB
方法來評估 XPath 布林運算式。
props
props.myProperty
擷取屬性值
myProperty
MediationContext
props['bean.property']
擷取屬性值
bean.property
MediationContext
spring
spring.getBean('fred').name
擷取
name
名為「」的 Bean 的屬性內容
Fred
在 Spring 環境定義中。
spring.parent ApplicationContext
存取 Spring 應用程式環境定義。
util
props['is.last.record'] = util.isLastMessageInBatch()
檢查中的目前訊息
MediationContext
是拆分器元件將產生的最後一條訊息。
<ns:Message_Summary>@{util.cleanString(props['is.message.summary'])}</ns:Message_Summary>
實作
cleanString(String)
函數,確保程序集元件產生格式正確的 XML。
vars
vars['myVariable'].length
擷取變數的長度
myVariable
vars['myVariable'].mimeType
擷取與變數相關聯的 MIME 類型
myVariable
xmldiff
xmldiff.isDifferent() == true
檢查 2 個文件之間是否存在差異。
xmldiff.changes
擷取 2 個文件之間的差異清單。