ほとんどの場合、エラー・メッセージは、メッセージ・テキストに示された問題を解決するために処置を行うように要求します。 日常の同期管理を単純化するために、特定のエラー・メッセージ が発行されたときに、これらの処置を自動的に実行する独自のロジックを追加することができます。
手順
DSYUserExits.properties
このファイルは、メッセージ番号がログに書き込まれるときに実行される ルーチンまたはプログラムとメッセージ番号を関連付けます。このプロパティー・ファイルは、 多くのさまざまなパラメーターをサポートします。
# Formats:
# {DSY message id}={class to execute} {environment parameters}
# {DSY message id}={command to execute} {environment parameters}
# where
# {DSY message id}:
# a DSY* message id that you want to define a user exit for (such as
# DSYD000E)
# {class to execute}:
# the name the Java .class to execute. This class must implement the
# com.ibm.mobileservices.DSYUserExitsInterface
# {command to execute}:
# the name the command to execute (such as pager.exe)
# {environment parameters}:
# a series of parameters to pass in to the class or command to execute
#
# Optional command tags:
# <DSYID> = the message id
# <DSYIDMSG> = the message id message text
# <DSYIDMSG_> = the message id message text, but all blanks are
# converted to underscores
# <DSYMSG> = the message text
# <DSYMSG_> = the message text, but all blanks are converted to
# underscores.
# <SERVER_IPADDRESS> = the server ip address (such as 9.112.19.143)
# <SERVER_NAME> = the server name (such as mpauser.stl.ibm.com)
#
# Refer to the messages section for available DSY message ids.
#
# Example 1:
# If you wanted to have user exists for DSYD000E, you would add a line
# similar to the following:
#
# DSYD000E=pager.exe number=5551234 id=<DSYID> msg=<DSYMSG_>
#
# When a DSYD000E message was issued, the pager.exe command would be executed
# with two environment parameters would be set: number=5551234, id=DSYD000E
# and msg=DSY message text, substituting an underscore (_) for blanks.
#
# Example 2:
# If you wanted to have a class executed when a DSYD020E was encountered,
# you would add a line similar to the following:
#
# DSYD020E=com.ibm.mobileservices.DSYUserExitsSample.class
#
# When a DSYD020E was issued, the com.ibm.mobileservices.DSYUserExitsSample
# class would be executed.
message_number=action parameter=value上の形式で、
実行される処置は、有効なルーチンまたはプログラムを指していなければなりません。
例えば、メッセージ DSYD000E が発行されたときに、 ページ表示を行うユーザー出口を組み込むと仮定します。ページャーにダイヤルする pager.exe と呼ばれるプログラムを作成し、ページャー番号をパラメーターとして指定できます。 DSYUserExits ファイルにおける行は次のようになります。
DSYD000E=pager.exe number=9980674
コマンドで次のパラメーターおよび変数を指定することもできます。
次の例は同一のページャーにダイヤルしますが、メッセージ番号およびそのテキストが 「Pager (ページャー)」ウィンドウに表示されるように、それらの両方をパラメーターと してサブミットします。
DSYD000E=pager.exe number=9980674 id=dsyid msg=dsymsg
同期サーバーは、DSYUserExits プロパティー・ファイルの項目の妥当性のチェックを行わず、 メッセージに関連付けられた処置が完了したかどうかもチェックしません。
ユーザー出口ルーチンをテストするには、DSYUserExitsTest.bat ファイル・ツールを使用します。以下の形式を使用してテストします。
DSYUserExitsTest.bat dsy_message_id
ここで、dsy_message_id は、シミュレートするメッセージ番号です。メッセージ ID を指定しなければ、使用可能なメッセージ ID のリストが表示されます。
メッセージ ID が DSYS001I のコマンド例は次のとおりです。
DSYUserExitsTest.bat dsys001i
DSYS001I メッセージが生成され、このメッセージ番号に定義されているユーザー出口 が開始されます。
以下は、無効なメッセージ番号を指定したコマンド例です。
DSYUserExitsTest.bat zzz
DSYUserExitsTest ツールの出力は、以下のようになります。
DSYUserExitsTest
DSY message id 'ZZZ' not found. Valid DSY message id's are:
DSYA000E, DSYA001E, DSYD000E, DSYD002E, DSYD006E, DSYD007E, ...
関連した概念
関連したタスク