> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SendForProcessing

> 複数ドキュメントのCase用に、SendForProcessing Pegaアクティビティを設定します。バッチを作成し、各添付ファイルを追加して処理を開始し、BatchIdを保存します。

アクティビティの作成について詳しくは、[Pega アクティビティの作成](/ja/flexi-capture/connectors/pega/pega-activity-create)を参照してください。

<div id="pages-classes">
  ## ページ & クラス
</div>

| **ページ名**       | **クラス**              |
| -------------- | -------------------- |
| Case           | Work-                |
| Attachment     | Data-WorkAttach-File |
| AttachmentInfo | Data-WorkAttach-File |

<div id="parameters">
  ## パラメーター
</div>

| **名前** | **データ型** | **必須** |
| ------ | -------- | ------ |
| CaseId | String   | はい     |

<div id="local-variables">
  ## ローカル変数
</div>

| **名称**      | **データ型** |
| ----------- | -------- |
| LinkedRefTo | String   |
| Id          | String   |
| BatchId     | String   |

<div id="steps">
  ## Steps
</div>

Step 1:

**メソッド**: Obj-Open-By-Handle.

**ステップページ**: Case。

**InstanceHandle**: Param.CaseId.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega129.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=264503b5f2e968c537e056eb862a4b3d" alt="Obj-Open-By-Handle メソッド、Case の ステップページ、Param.CaseId の InstanceHandle で設定された Pega のステップ 1 のスクリーンショット。" width="1112" height="330" data-path="images/flexi-capture/connectors/Pega129.png" />
</Frame>

Step 2:

**メソッド**: Page-Set-Messages

**メッセージ**: "続行する前に、ケースにファイルを追加してください。"

**条件**:

| **条件**            | **true の場合** | **true時のパラメーター** | **false の場合** | **false時のパラメーター** |
| ----------------- | ------------ | ---------------- | ------------- | ----------------- |
| AttachmentsIsNull | 継続条件         |                  | Stepをスキップ     |                   |

<Note>
  条件を作成するには、**When** フィールドに *AttachmentsIsNull* を指定し、設定ボタンをクリックします。そのような条件がまだ存在しない場合は、新しい条件を作成できるウィンドウが開きます。**Apply to** フィールドにケースの完全名が指定されていることを確認し、**Create and open** をクリックします。**Conditions** タブで、次の条件を作成します: *length of .pyAttachments is Equal To 0*。条件を追加するには、**Configure advanced conditions here…** をクリックし、条件タイプとして *length of \[a pagelist property] Is \[comparison operator] \[value]* を選択します。
</Note>

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega206.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=832bc4ad8667169ff7d0a47d18a09233" alt="AttachmentsIsNull 条件を .pyAttachments の長さが 0 と等しいものとして定義している、Pega の Condition ダイアログのスクリーンショット。" width="590" height="205" data-path="images/flexi-capture/connectors/Pega206.png" />
</Frame>

**ジャンプ**:

| **条件** | **true の場合** | **true の場合のパラメーター** | **false のとき** | **false時のパラメーター** |
| ------ | ------------ | ------------------- | ------------- | ----------------- |
| true   | アクティビティを終了   |                     |               |                   |

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega131.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=f6dac5fa332eca91b0d87004b1766f09" alt="Page-Set-Messages メソッドを使用し、続行する前にケースにファイルを追加するようユーザーに促すテキストに Message が設定されている、Pega のステップ 2 のスクリーンショット。" width="1124" height="246" data-path="images/flexi-capture/connectors/Pega131.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega132.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=301dc06d8ee79e25f99a08e5ac606abc" alt="ステップ 2 の Pega の When 条件ダイアログのスクリーンショット。AttachmentsIsNull 条件が、true の場合は Continue Whens、false の場合は Skip Step に設定されています。" width="991" height="229" data-path="images/flexi-capture/connectors/Pega132.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega133.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=05101cb84668bb92da9eef7fb6b16015" alt="true の When 値によってアクティビティを終了するよう設定された、Pega のステップ 2 のジャンプ条件のスクリーンショット。" width="991" height="282" data-path="images/flexi-capture/connectors/Pega133.png" />
</Frame>

Step 3:

**メソッド**: Call-Function

| **関数**                  | **戻り値**       |
| ----------------------- | ------------- |
| @ABBYY.CreateNewBatch() | Local.BatchId |

詳細については、[CreateNewBatch](/ja/flexi-capture/connectors/pega/pega-func-multiple-docs#createnewbatch)を参照してください。

**ジャンプ**:

| **条件**         | **true の場合**       | **true時のパラメーター** | **false のとき** | **false 時のパラメーター** |
| -------------- | ------------------ | ---------------- | ------------- | ------------------ |
| StepStatusFail | Jump to Later Step | ERR              |               |                    |

**例外発生時にジャンプする後続ステップのラベル**: ERR。

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega134.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=4ff42d9611966705f28822c6b6d83dae" alt="Call-Function メソッドを使用し、関数 @ABBYY.CreateNewBatch() と戻り値 Local.BatchId が設定されている、Pega のステップ 3 のスクリーンショット。" width="1106" height="242" data-path="images/flexi-capture/connectors/Pega134.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega135.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=4637c13bb148f6c95a76168be96679a0" alt="StepStatusFail 条件が true の場合に後続のステップ ERR にジャンプし、例外発生時ラベルが ERR に設定されている、Pega のステップ 3 のジャンプ条件のスクリーンショット。" width="989" height="279" data-path="images/flexi-capture/connectors/Pega135.png" />
</Frame>

Step 4:

**メソッド**: Property-Set

| **PropertiesName** | **PropertiesValue**                          |
| ------------------ | -------------------------------------------- |
| Local.LinkedRefTo  | Case.pyAttachments(\<CURRENT>).pxLinkedRefTo |
| Local.Id           | Case.pyAttachments(\<CURRENT>).pzInsKey      |

**ループ**:

| **繰り返し**     | **値リストのプロパティ**     |
| ------------ | ------------------ |
| 値リストの各要素に対して | Case.pyAttachments |

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega136.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=f4a8ca8d62742c7f376f38700cc11698" alt="Pega のステップ 4 で Property-Set メソッドを使用しているスクリーンショット。Local.LinkedRefTo は現在の Case.pyAttachments 要素の pxLinkedRefTo に、Local.Id はその pzInsKey に設定されています。" width="1092" height="236" data-path="images/flexi-capture/connectors/Pega136.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega137.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=e85f94b87589d370222f6a4886ee19a0" alt="Pega のステップ 4 における Loop ダイアログのスクリーンショット。Repeat は For each element in value list に、Value List Property は Case.pyAttachments に設定されています。" width="453" height="150" data-path="images/flexi-capture/connectors/Pega137.png" />
</Frame>

サブステップ 1:

**メソッド**: Obj-Open-By-Handle.

**ステップページ**: Attachment.

**InstanceHandle**: Local.LinkedRefTo.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega138.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=3b89f21720558e2ce48925a0bebaf9d1" alt="Pega のサブステップ 1 のスクリーンショット。Obj-Open-By-Handle メソッド、Attachment ステップページ、InstanceHandle に Local.LinkedRefTo が設定されています。" width="1066" height="301" data-path="images/flexi-capture/connectors/Pega138.png" />
</Frame>

サブステップ 2:

**メソッド**: Obj-Open-By-Handle.

**ステップページ**: AttachmentInfo.

**InstanceHandle**: Local.Id.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega139.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=95b2eaaf9b38142afbeb68af34949462" alt="Pega のサブステップ 2 のスクリーンショット。Obj-Open-By-Handle メソッド、AttachmentInfo ステップページ、InstanceHandle に Local.Id が設定されています。" width="1069" height="299" data-path="images/flexi-capture/connectors/Pega139.png" />
</Frame>

サブステップ 3:

**メソッド**: Call-Function

| **関数**                                                                                     | **戻り値** |
| ------------------------------------------------------------------------------------------ | ------- |
| @ABBYY.AddDocumentToBatch(Local.BatchId, AttachmentInfo.pyMemo, Attachment.pyAttachStream) |         |

詳しくは、[AddDocumentToBatch](/ja/flexi-capture/connectors/pega/pega-func-multiple-docs#adddocumenttobatch)を参照してください。

**ジャンプ**:

| **条件**         | **if true**        | **true param** | **if false** | **false param** |
| -------------- | ------------------ | -------------- | ------------ | --------------- |
| StepStatusFail | Jump to Later Step | ERR            |              |                 |

**例外発生時にジャンプする後続ステップのラベル**: ERR.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega140.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=72a3fbb25ece8278700433b0732c39fa" alt="Pega のサブステップ 3 で Call-Function メソッドを使用しているスクリーンショット。関数は @ABBYY.AddDocumentToBatch(Local.BatchId, AttachmentInfo.pyMemo, Attachment.pyAttachStream) で、戻り値はありません。" width="1067" height="201" data-path="images/flexi-capture/connectors/Pega140.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega141.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=43fad5c2f66fe2391b73bd83dc5668f9" alt="Pega のサブステップ 3 のジャンプ条件のスクリーンショット。StepStatusFail 条件が設定されており、true の場合は後続のステップ ERR にジャンプし、例外発生時のラベルは ERR に設定されています。" width="990" height="279" data-path="images/flexi-capture/connectors/Pega141.png" />
</Frame>

ステップ 5:

**メソッド**: Call-Function

| **関数**                                   | **戻り値** |
| ---------------------------------------- | ------- |
| @ABBYY.RunBatchProcessing(Local.BatchId) |         |

詳しくは、[RunBatchProcessing](/ja/flexi-capture/connectors/pega/pega-func-multiple-docs#runbatchprocessing)を参照してください。

**ジャンプ**:

| **条件**         | **if true**        | **true param** | **if false** | **false param** |
| -------------- | ------------------ | -------------- | ------------ | --------------- |
| StepStatusFail | Jump to Later Step | ERR            |              |                 |

**例外発生時にジャンプする後続ステップのラベル**: ERR.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega142.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=bfe753784aa3f6d2b6a8f565163a6730" alt="Pega のステップ 5 で Call-Function メソッドを使用しているスクリーンショット。関数は @ABBYY.RunBatchProcessing(Local.BatchId) で、戻り値はありません。" width="1095" height="202" data-path="images/flexi-capture/connectors/Pega142.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega143.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=8f2888d8319a6d80fae266b87a054b60" alt="Pega のステップ 5 のジャンプ条件のスクリーンショット。StepStatusFail 条件が設定されており、true の場合は後続のステップ ERR にジャンプし、例外発生時のラベルは ERR に設定されています。" width="986" height="276" data-path="images/flexi-capture/connectors/Pega143.png" />
</Frame>

ステップ 6:

**メソッド**: Call-Function

| **関数**                                                                    | **戻り値**          |
| ------------------------------------------------------------------------- | ---------------- |
| @ABBYY.WaitFirstVerificationOrProcessedForMultiFileInvoice(Local.BatchId) | .VerificationUrl |

詳しくは、[WaitFirstVerificationOrProcessedForMultiFileInvoice](/ja/flexi-capture/connectors/pega/pega-func-multiple-docs#waitfirstverificationorprocessedformultifileinvoice)を参照してください。

**ジャンプ**:

| **When**       | **true の場合**       | **true パラメーター** | **false の場合**      | **false パラメーター** |
| -------------- | ------------------ | --------------- | ------------------ | ---------------- |
| StepStatusFail | Jump to Later Step | ERR             | Jump to Later Step | OK               |

**例外発生時にジャンプする後続ステップのラベル**: ERR。

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega144.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=00819c28fc617143f6ac143019f94d8c" alt="Call-Function メソッドを使用し、関数 @ABBYY.WaitFirstVerificationOrProcessedForMultiFileInvoice(Local.BatchId) と戻り値 .VerificationUrl を設定した、Pega のステップ 6 のスクリーンショット。" width="1084" height="196" data-path="images/flexi-capture/connectors/Pega144.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega145.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=fcf586e2ab1e6107c3b2888bddc71b36" alt="Pega のステップ 6 のジャンプ条件のスクリーンショット。StepStatusFail 条件があり、true の場合は後続のステップ ERR にジャンプし、false の場合は OK にジャンプし、例外時のラベルは ERR です。" width="987" height="276" data-path="images/flexi-capture/connectors/Pega145.png" />
</Frame>

ステップ 7:

**Label**: ERR。

**Method**: Page-Set-Messages。

**Message**: @unescapeHTML(@getWorstMessageName(tools))。

詳細は、[unescapeHTML](/ja/flexi-capture/connectors/pega/pega-func-other)を参照してください。

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega146.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=2e3b7ca6205295f551b268fb129a88bf" alt="ERR というラベルの付いた Pega のステップ 7 のスクリーンショット。Page-Set-Messages メソッドを使用し、Message に @unescapeHTML(@getWorstMessageName(tools)) が設定されています。" width="876" height="187" data-path="images/flexi-capture/connectors/Pega146.png" />
</Frame>

ステップ 8:

**Label**: OK。

**Method**: Property-Set。

| **PropertiesName** | **PropertiesValue** |
| ------------------ | ------------------- |
| .BatchId           | Local.BatchId       |

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega147.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=c7d066f827fc0257c0100de2c2946d1f" alt="OK というラベルの付いた Pega のステップ 8 のスクリーンショット。Property-Set メソッドを使用し、PropertiesName の .BatchId に PropertiesValue の Local.BatchId が設定されています。" width="1101" height="190" data-path="images/flexi-capture/connectors/Pega147.png" />
</Frame>
