機械翻訳について

カスタム・オブジェクト関数の作成

ここで、次の関数を作成します。

関数名

目的

getContactsInRange

指定範囲内の担当者のパーティIDを返します。

migrateContactsInRange

指定範囲内のすべての担当者を移行します。

migrateBatch <N>

ユーザーのバッチを移行します。 実行するバッチごとに1つの関数を作成する必要があります。

  1. アプリケーション・コンポーザで「カスタム・オブジェクト」を展開し、「PudsUserMigrator」ノードを展開します。

  2. 「サーバー・スクリプト」を選択し、「オブジェクト機能」タブをクリックします。

  3. 「処理」ドロップダウン・リストをクリックし、新規オブジェクト機能の追加を選択します。

  4. オブジェクト機能の作成ページで、次の手順を実行します。

    1. 「機能名」フィールドに、getContactsInRangeと入力します。

    2. 「戻り値」ドロップダウン・リストをクリックし、「リスト」を選択します。

    3. 「パラメータ」領域を展開し、パラメータの追加アイコンをクリックします。

    4. 「名前」フィールドにstartと入力し、「タイプ」ドロップダウン・リストからLongを選択します。

    5. パラメータの追加アイコンを再度クリックします。

    6. 「名前」フィールドにendと入力し、「タイプ」ドロップダウン・リストからLongを選択します。

    7. 「スクリプトの編集」フィールドに次のコードを貼り付けます。

      def partyList = [];
      def selfRegnVO = newView('SelfRegistrationVO');
       
      selfRegnVO.appendViewCriteria("""
      (ContactPartyId between '${start}' and '${end}' ) AND StatusCd = 'ORA_CSS_APPROVED'
      """)
       
      selfRegnVO.setMaxFetchSize(6000)
      selfRegnVO.executeQuery()
       
      while (selfRegnVO.hasNext()){
         def curRow = selfRegnVO.next();
         partyList.add(curRow.ContactPartyId);
      }
      partyList = partyList.unique()
      return partyList.sort();
    8. 「保存してクローズ」をクリックします。

  5. 新規オブジェクト機能の追加アイコンをクリックし、オブジェクト機能の作成ページで次の手順を実行します。

    1. 「機能名」フィールドに、migrateContactsInRangeと入力します。

    2. 「戻り値」ドロップダウン・リストをクリックし、「文字列」を選択します。

    3. 「パラメータ」領域を展開し、パラメータの追加アイコンをクリックします。

    4. 「名前」フィールドにstartと入力し、「タイプ」ドロップダウン・リストからLongを選択します。

    5. パラメータの追加アイコンを再度クリックします。

    6. 「名前」フィールドにendと入力し、「タイプ」ドロップダウン・リストからLongを選択します。

    7. 「スクリプトの編集」フィールドに次のコードを貼り付けます。

      def contactPartyIdList = getContactsInRange(new Long(start), new Long(end)) as Long[];
       
       
      if(contactPartyIdList.size() == 0){
        throw new oracle.jbo.ValidationException('There are no contacts identified by the given partyId range: ' + start + "-" + end);
      }
       
      if(contactPartyIdList.size() > 2000){
        throw new oracle.jbo.ValidationException('There are more than 2000 contacts identified by the given partyId range: ' + start + "-" + end);
      }
       
      def contactPartyIds = contactPartyIdList as Long[];
      def idpDestination = "ORA_CSS_IDP_IDCS";
      def mgr = oracle.apps.crm.service.css.migrationService.util.IdpMigrationManager.getInstance(idpDestination, 100, 2000);
      def msg = mgr.migrate(contactPartyIds);
      return msg;
    8. 「保存してクローズ」をクリックします。

  6. 新規オブジェクト機能の追加をクリックし、オブジェクト機能の作成ページで次の手順を実行します。

    1. 「機能名」フィールドに、migrateBatch<N>と入力します。

    2. 「戻り値」ドロップダウン・リストをクリックし、「文字列」を選択します。

    3. 「表示」の値を外部システムで呼出し可能に変更します。

    4. 「スクリプトの編集」フィールドに次のコードを貼り付けます。

      def batchStartContactPartyId = ?L;
      def batchEndContactPartyId = ?L;
       
      def msg = migrateContactsInRange(new Long(batchStartContactPartyId), new Long(batchEndContactPartyId));
       
      return msg;
      ノート: ?Lは、セルフサービス最適化のユーザーのパーティション化のトピックで説明する、担当者パーティIDの開始と終了の値に置換する必要があります。 この値を変更せずに保存すると、スクリプトからエラーがスローされます。
    5. 「保存してクローズ」をクリックします。

      ノート: パーティション化ロジック出力に応じて必要な数のmigrateBatchジョブを作成します。