> ## 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.

# インストール

> PegaサーバーにABBYY FlexiCaptureコネクタをインストールします。JARをインポートし、パッケージと静的変数を含むライブラリを作成して、関数を定義します。

PEGAをインストールするには、次の手順を実行します。

[Pegaサーバーにコネクタをインポートする](#import)

[ライブラリを作成する](#lib)

[必要な関数を作成する](#func)

## <a id="import" />Pegaサーバーへのコネクタのインポート

コネクタをサーバーにインポートするには、次の手順を実行します。

1. **Dev Studio**を開き、**Configure → Application → Distribution → Import**をクリックします。

   <Frame>
     <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega1.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=a341f96a004c8a19fb49207d18680709" alt="コネクタをインポートするために、Configure メニューを開き、Application → Distribution → Import を選択している Pega Dev Studio のスクリーンショット。" width="935" height="329" data-path="images/flexi-capture/connectors/Pega1.png" />
   </Frame>

2. **abbyy.flexicapture.webapi.client.jar**ファイルをサーバーにロードします。

3. **Pega Self-Service Portal**を開き、**Restart Server**をクリックします。

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega2.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=eecde34cbec1e5bd944b2b7b9ae52933" alt="アプリケーションサーバーを再起動するために、Restart Server ボタンが強調表示された Pega Self-Service Portal の Operations ページのスクリーンショット。" width="537" height="297" data-path="images/flexi-capture/connectors/Pega2.png" />
</Frame>

## <a id="lib" />ライブラリの作成

ライブラリを作成するには、次の手順を実行します。

1. **Records → Technical → Library → Create** をクリックします。

2. **Create Library** タブの **Label** フィールドにライブラリ名 (例: *ABBYY*) を指定し、**Identifier** フィールドに入力します。ライブラリがアプリケーションのコンテキスト内に作成されることを確認し、**Create and open** をクリックします。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega52.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=3ca766b1ed9d2c5b38309ae1a1712219" alt="Pega の Create Library フォームのスクリーンショット。Label フィールドと Identifier フィールドに ABBYY が入力され、アプリケーションコンテキストとして FlexiCapture for Invoices が選択されています。" width="1227" height="429" data-path="images/flexi-capture/connectors/Pega52.png" />
   </Frame>

3. **パッケージ** タブで、次のパッケージを追加します。

   * *java.util.*\*
   * *java.nio.file.*\*
   * *java.net.*\*
   * *java.lang.*\*
   * *java.util.stream.*\*
   * *org.apache.commons.lang3.*\*
   * *abbyy.flexicapture.webapi.client.*\*
   * *abbyy.flexicapture.webapi.client.api.*\*
   * *abbyy.flexicapture.webapi.client.models.*\*

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega53.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=0176835eae98534710c3ae9402e84117" alt="Pega Dev Studio のライブラリの パッケージ タブのスクリーンショット。abbyy.flexicapture.webapi.client パッケージを含む 9 つの Java パッケージが一覧表示され、その下に Generate Library ボタンがあります。" width="601" height="702" data-path="images/flexi-capture/connectors/Pega53.png" />
   </Frame>

4. **静的変数** タブで、次の string 変数を作成します。

   * *baseUri*
   * *tenantName*
   * *userName*
   * *Password*
   * *multiFileProjectName*
   * *singleFileProjectName*

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega54.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=eccb393f811a02438cfc1de83cf4032c" alt="Pega Dev Studio のライブラリの 静的変数 タブのスクリーンショット。baseUri、tenantName、userName、password、multiFileProjectName、singleFileProjectName の String 変数とそのサンプル値が表示されています。" width="844" height="412" data-path="images/flexi-capture/connectors/Pega54.png" />
   </Frame>

5. **Save** をクリックし、続けて **Generate Library** をクリックします。

## <a id="func" />関数の作成

関数には Java コードが含まれており、その関数が他の Pega オブジェクトから呼び出されると実行されます。関数の入出力パラメーターは **Parameters** タブで指定し、例外は **Imports & Exceptions** タブで指定します。

関数を作成するには、次の手順に従います。

1. **Records → Technical → Function → Create** をクリックし、**Label** フィールドと **Identifier** フィールドに必要事項を入力します。
2. **Library** フィールドで、先ほど作成したライブラリの名前を指定します。
3. **Parameters** セクションで、次の 2 つの入力パラメーターを指定します。

| **Name**        | **Java type** |
| --------------- | ------------- |
| *FileName*      | *String*      |
| *Base64Content* | *String*      |

4. 関数がアプリケーションのコンテキスト内で作成されていることを確認し、**Create and open** をクリックします。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega55.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=31cfe52be7c6f5dafac9590265e87b98" alt="Pega の Create Function フォームのスクリーンショット。Label フィールドに SendForProcessing が入力され、ABBYY ライブラリが選択され、fileName と base64Content の String パラメーターが一覧表示され、アプリケーションコンテキストとして FlexiCapture for Invoices が選択されています。" width="819" height="471" data-path="images/flexi-capture/connectors/Pega55.png" />
   </Frame>

5. 開いたウィンドウの **Parameters** タブで、**Java data type** フィールドにデータ型として *int*、*string*、または *boolean* を指定します。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega56.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=3a4b847cb643cb18d26c637c4bdfbede" alt="関数の Parameters タブを表示している Pega Dev Studio のスクリーンショット。fileName と base64Content の String 入力パラメーターが表示され、Output セクションの Java data type に int が入力されています。" width="1455" height="667" data-path="images/flexi-capture/connectors/Pega56.png" />
   </Frame>

6. **Imports & Exceptions** タブをクリックし、**Exceptions thrown** セクションに *Exception* と入力します。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega57.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=3be1a89418a95c69bbb6d6ab3621aca7" alt="関数の Imports & Exceptions タブを表示している Pega Dev Studio のスクリーンショット。Exceptions thrown セクションに Exception が入力されています。" width="571" height="288" data-path="images/flexi-capture/connectors/Pega57.png" />
   </Frame>

7. **Java** タブに戻り、**Java source** フィールドに関数のコードを入力し、**Function ready to be compiled?** オプションを選択して変更を保存し、**Generate function** をクリックします。

<Note>
  関数のコードは、*%Installation Path%\Connector for FlexiCapture as a Service with verification\Samples\Code examples\Pega Functions* にある java ファイルからコピーできます。
</Note>

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega58.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=d81b7efb0a7f8d87df6ef3325ea26832" alt="関数の Java タブを表示している Pega Dev Studio のスクリーンショット。Function ready to be compiled オプションが選択され、Generate function ボタンと、FlexiCapture の batch を作成してその identifier を返す Java ソースコードが表示されています。" width="1014" height="720" data-path="images/flexi-capture/connectors/Pega58.png" />
</Frame>

単一文書処理のシナリオを実装するには、次の作業が必要です。

1. [単一文書の処理に使用する一連の関数を作成する](/ja/flexi-capture/connectors/pega/pega-func-one-doc)。
2. [共通関数を作成する](/ja/flexi-capture/connectors/pega/pega-func-other)。
3. [単一文書処理のケースを作成する](/ja/flexi-capture/connectors/pega/pega-one-doc-case)。
4. [ユーザーインターフェースを構成する](/ja/flexi-capture/connectors/pega/pega-config-ui-1)。
5. [単一文書処理のケース用の一連の activities を作成する](/ja/flexi-capture/connectors/pega/pega-activities-one-doc)。
6. [単一文書処理のケース用の一連の data transforms を作成する](/ja/flexi-capture/connectors/pega/pega-dt-one-doc)。
7. [フローアクションを作成する](/ja/flexi-capture/connectors/pega/pega-flow-action)。
8. [単一文書処理のケース用のデータ型を作成する](/ja/flexi-capture/connectors/pega/pega-one-doc-data-type)。

複数文書処理のシナリオを実装するには、次の作業が必要です。

1. [複数文書の処理に使用する一連の関数を作成する](/ja/flexi-capture/connectors/pega/pega-func-multiple-docs)。
2. [共通関数を作成する](/ja/flexi-capture/connectors/pega/pega-func-other)。
3. [複数文書処理のケースを作成する](/ja/flexi-capture/connectors/pega/pega-many-docs-case)。
4. [HTML フラグメントを作成する](/ja/flexi-capture/connectors/pega/pega-html)。
5. [複数文書処理のケース用の一連の activities を作成する](/ja/flexi-capture/connectors/pega/pega-activities-many-docs)。
6. [複数文書処理のケース用の一連の data transforms を作成する](/ja/flexi-capture/connectors/pega/pega-dt-many-docs)。
7. [フローアクションを作成する](/ja/flexi-capture/connectors/pega/pega-flow-action)。
8. [複数文書処理のケース用のデータ型を作成する](/ja/flexi-capture/connectors/pega/pega-many-docs-data-types)。
