カスタムファンクションを使用する場合,最初にカスタムファンクションで使用する次の二つを作成します。
それぞれを作成する手順を次に示します。
<uCosminexus Service Architectのインストールディレクトリ>¥CSCTE¥resources¥customfunc
表5-12 変換ファンクション定義ファイルに定義する内容
要素 | 定義する内容 |
---|---|
xml | version="1.0" encoding="UTF-8" |
func:customFunc | - |
xmlns:func | http://www.hitachi.co.jp/soft/xml/cosminexus/cscdt/functions |
xmlns:xsi | http://www.w3.org/2001/XMLSchema-instance |
xsi:schemaLocation | http://www.hitachi.co.jp/soft/xml/cosminexus/cscdt/functions customfunction_XMLSchema.xsd |
func:jar | - |
name | CustomFunctions.jar |
func:package | - |
name | sample.transform.CustomFunction |
func:class | - |
name | CustomFunctions |
func:method | - |
name | changeCase |
func:comment | 変換前文字列に含まれる英字を変換フラグの指定に応じて大文字,または小文字に変換して変換後文字列に出力する。 |
func:arguments | - |
func:argument | - |
name | text |
func:comment | 変換前文字列 |
func:argument | - |
name | flag |
func:comment | 変換フラグ(upper | lower) |
func:method | - |
name | currentDateTime |
func:comment | 現在の日時を「yyyy/MM/dd HH:mm:ss.SSS」フォーマットで出力する。 |
CustomFunctionサンプルプログラムでは,次のJavaプログラムを呼び出すカスタムファンクションを作成します。
図5-4 カスタムファンクションから呼び出すJavaプログラム
CustomFunctionサンプルプログラムでは,このJavaプログラムの処理がコーディングされたソースファイル(CustomFunctions.java)が用意されています。このソースファイルをインポートおよびパッケージングして,カスタムファンクションから呼び出すJavaプログラムを作成します。
Javaプログラムを作成する手順を次に示します。
<uCosminexus Service Architectのインストールディレクトリ>¥CSC¥userlib¥customfunc