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

# Set up the sample Pega application

> Import the ABBYY Vantage sample Pega application, add it as a built-on application, and configure case types to process documents with ABBYY Vantage.

Set up the ABBYY Vantage Connector for Pega by importing the sample application, adding it to your own application as a built-on application, and configuring a case type to process documents.

Download the ABBYY Vantage Connector for Pega from the [ABBYY Marketplace](https://www.abbyy.com/marketplace/assets/host/abbyy/connector/pega/). The download is a ZIP archive containing a Pega application configured to work with ABBYY Vantage, along with sample images and a connector guide.

The sample application contains `AbbyyVantageComponent`, which includes:

* A set of Connect REST rules
* An authentication profile
* Dynamic System Settings used by the connector
* A **Process documents** case type that demonstrates how the connector works
* Data pages, data transforms, activities, flows, flow actions, and other rules

You can inspect these rules after importing the application.

## Import the application

<Steps>
  <Step title="Open the Import wizard">
    Open Pega Dev Studio. In the upper area of the window, select **Configure > Application > Distribution > Import** to launch the Import wizard.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/import-wizard.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=f19f6c798711c84c9b5978a2dca05d7d" alt="Pega Dev Studio Import wizard launched from Configure, Application, Distribution, Import" width="1035" height="386" data-path="images/vantage/developer/connectors/pega/import-wizard.png" />
    </Frame>
  </Step>

  <Step title="Import the application file">
    Import the `Abbyy_Vantage_Sample_App_v1.4.jar` file to the server.
  </Step>
</Steps>

### Grant access to the application

<Steps>
  <Step title="Open the operator menu">
    Open the menu for the appropriate operator. To choose the current operator, click the icon in the lower-left area of the window and select **Operator**. The **Edit Operator ID** window opens.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/edit-operator-id.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=c263abdb340cd425737856cf4da81df8" alt="Edit Operator ID window in Pega" width="815" height="248" data-path="images/vantage/developer/connectors/pega/edit-operator-id.png" />
    </Frame>
  </Step>

  <Step title="Add the access group">
    In the **Application Access** section of the **Edit Operator ID** window, add the `VantageA:Authors` access group.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/operator-application-access.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=9c55632aca82c1f6a9de9369556466e6" alt="Application Access section with the VantageA:Authors access group added" width="1027" height="701" data-path="images/vantage/developer/connectors/pega/operator-application-access.png" />
    </Frame>
  </Step>

  <Step title="Log out and log in">
    Log out and log in again. The application then appears in the **Application > Switch Application** menu.
  </Step>
</Steps>

## Add AbbyyVantageSample to built-on applications

If you have a Pega application already, proceed with this section. Otherwise, jump to [Configure a connection to ABBYY Vantage](/vantage/connectors/pega/configure-connection) to continue setup with the `AbbyyVantageSample` application directly.

After `AbbyyVantageSample` is imported, add it as a built-on application to your own application. This lets you reuse the sample application's elements in your application.

<Note>
  The sample application is built on the Theme Cosmos UI. If your application uses a different UI, create a new application with the Theme Cosmos UI and follow this section to configure it. If your Pega project has a different UI configuration or a headless implementation, you can invoke the process flow and data model of the ABBYY Vantage component and configure the sections according to your business scenario.
</Note>

<Steps>
  <Step title="Open your application definition">
    Navigate to **Records > Application Definition > Application** and open your application.
  </Step>

  <Step title="Add the built-on application">
    In the **Built on applications** section of the **Definition** tab, click **+Add application**. Enter `AbbyyVantageSample` in the **Name** field and select `02.01.01` in the **Version** field.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/add-built-on-application.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=423d219c9680dceab7c75586d9936a35" alt="Built on applications section with AbbyyVantageSample version 02.01.01 added" width="1001" height="553" data-path="images/vantage/developer/connectors/pega/add-built-on-application.png" />
    </Frame>
  </Step>

  <Step title="Save the application">
    Save the application. You can now reuse the elements of `AbbyyVantageSample`.
  </Step>
</Steps>

### Inspect the component rules

<Steps>
  <Step title="Open Components">
    Open **Configure > Application > Components**.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/application-components.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=2eca8209bd96750a3a3f05d716720e42" alt="Pega Components page under Configure, Application, Components" width="871" height="476" data-path="images/vantage/developer/connectors/pega/application-components.png" />
    </Frame>
  </Step>

  <Step title="Open the component rulesets">
    Open `AbbyyVantageComponent`, and then open the rulesets in the **Component rulesets** section to inspect the rules.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/component-rulesets.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=2b3bd7ea42464f683b94e204084d32aa" alt="AbbyyVantageComponent rulesets in the Component rulesets section" width="1002" height="269" data-path="images/vantage/developer/connectors/pega/component-rulesets.png" />
    </Frame>
  </Step>
</Steps>

## Create and configure case types

When `AbbyyVantageSample` is added to your application's built-on applications, create a case type to process documents with ABBYY Vantage.

### Create a case type and set inheritance

<Steps>
  <Step title="Create a case type">
    Switch to your application, which already has `AbbyyVantageSample` added as a built-on application. Go to the **Case types** menu and create a case type (for example, Invoice processing).

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/create-case-type.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=52bcd895644f8798d78b29659e3028a0" alt="Creating a new case type in the Pega Case types menu" width="735" height="632" data-path="images/vantage/developer/connectors/pega/create-case-type.png" />
    </Frame>
  </Step>

  <Step title="Open the class definition">
    Go to the **App** menu. On the **Classes** tab, right-click the class of the created case type, and then select **Definition**.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/case-type-class-definition.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=6d463c7e47d8aaac4df8bab88d2fd64e" alt="Classes tab with the case type class Definition option selected" width="1021" height="480" data-path="images/vantage/developer/connectors/pega/case-type-class-definition.png" />
    </Frame>
  </Step>

  <Step title="Change the class inheritance">
    In the **Class inheritance** section, change inheritance to `AbbyyVantage-Work-ProcessDocuments`, and then save the definition.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/class-inheritance.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=2109bb5ef8898f08cbc7b79cffb72a94" alt="Class inheritance section set to AbbyyVantage-Work-ProcessDocuments" width="1198" height="722" data-path="images/vantage/developer/connectors/pega/class-inheritance.png" />
    </Frame>
  </Step>
</Steps>

### Add steps to the case workflow

<Steps>
  <Step title="Open the case type stages">
    Open the **Case types** menu, right-click the created case type, and select **Open**. Open the **Stages** tab.
  </Step>

  <Step title="Replace the default Create process">
    In the **Initialization Stage** section, select **Create**. In the **Automatically launched processes** section, open the default `CreateForm_Default` process and delete it. Then select `CreateForm_Default (AbbyyVantage-Work-ProcessDocuments)` for the **Create** initialization stage.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/initialization-stage.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=0c6eee89768ab41abbc3e2cfbf1590c6" alt="Initialization Stage with the Create process and Automatically launched processes list" width="1223" height="546" data-path="images/vantage/developer/connectors/pega/initialization-stage.png" />
    </Frame>
  </Step>

  <Step title="Add the Get Status stage">
    Add a primary stage and name it (for example, Get Status). With this stage in focus, select `GetStatus (AbbyyVantage-Work-ProcessDocuments)` in the **Automatically launched processes** section.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/get-status-stage.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=2554cb4e63e30e473e09d95ab65a709c" alt="Get Status primary stage with GetStatus selected in Automatically launched processes" width="1217" height="969" data-path="images/vantage/developer/connectors/pega/get-status-stage.png" />
    </Frame>
  </Step>

  <Step title="Add the Get Processing Results stage">
    Add another primary stage and name it (for example, Get Processing Results). With this stage in focus, select `ViewDocument_Flow (AbbyyVantage-Work-ProcessDocuments)` in the **Automatically launched processes** section, and then save the case type.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/get-processing-results-stage.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=137400b60661bed35ee39c1a96394b4d" alt="Get Processing Results primary stage with ViewDocument_Flow selected" width="1236" height="954" data-path="images/vantage/developer/connectors/pega/get-processing-results-stage.png" />
    </Frame>
  </Step>
</Steps>

Once all stages are added, the case type workflow appears as follows:

<Frame>
  <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/case-workflow.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=675d4eeca8a0b941fb08bea8f50f3d2c" alt="Completed case type workflow with Create, Get Status, and Get Processing Results stages" width="950" height="459" data-path="images/vantage/developer/connectors/pega/case-workflow.png" />
</Frame>

### Add a section to the application context

<Steps>
  <Step title="Open the Create section">
    Navigate to **Records > User Interface > Section**. Find and open the **Create** section for the `AbbyyVantage:02-01-01` ruleset version.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/create-section.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=47a79ed30fbdd4417fedc204c3ee5e09" alt="Create section for the AbbyyVantage 02-01-01 ruleset version" width="914" height="275" data-path="images/vantage/developer/connectors/pega/create-section.png" />
    </Frame>
  </Step>

  <Step title="Save the section into your context">
    Click **Save As**. In the window that opens, ensure your application and its ruleset are selected in the **Context** section. Click **Create and open**, and then save the **Create** section.

    <Frame>
      <img src="https://mintcdn.com/abbyy/sAK9EyrYIxrZ9f2p/images/vantage/developer/connectors/pega/section-save-as.png?fit=max&auto=format&n=sAK9EyrYIxrZ9f2p&q=85&s=4bfe8efdab1780a04927d6ab53e672e5" alt="Save As window with the application and ruleset selected in the Context section" width="1007" height="666" data-path="images/vantage/developer/connectors/pega/section-save-as.png" />
    </Frame>
  </Step>
</Steps>

## Next steps

Continue to [Configure a connection to ABBYY Vantage](/vantage/connectors/pega/configure-connection).
