新しいインターフェースを生成し、カスタム Java™ コードを追加することでカスタム・メディエーション・プリミティブを実装します。
// メッセージの本体からシンボルを取得します。 String symbol = input1.getString("body/getQuote/symbol"); // シンボルがユーザーの優先リストにある場合、相関コンテキストの isPreferred フラグを「true」に設定します。 if (symbol.equals("ibm")) { // preferenceInformation ビジネス・オブジェクトを作成して、isPreferred フラグを true に設定します。 com.ibm.websphere.bo.BOFactory factory = (com.ibm.websphere.bo.BOFactory) new com.ibm.websphere.sca.ServiceManager().locateService("com/ibm/websphere/bo/BOFactory"); DataObject preferenceInformation = factory.create("http://CustomMediation", "PreferenceInformation"); preferenceInformation.setBoolean("isPreferred", true); // 相関コンテキストのビジネス・オブジェクトを設定します。 input1.setDataObject("context/correlation", preferenceInformation); } // DataObject に戻ります。 return input1;