Skip to main content
Installing the ABBYY FlexiCapture Connector for Pega takes two parts: importing the connector to the server, and creating a Java function in Pega that calls the connector classes.

Import the connector to the server

1

Open the Import wizard

Open Dev Studio and click Configure → Application → Distribution → Import.
Screenshot of Pega Dev Studio with the Configure menu open, showing the Application → Distribution → Import path being selected to import the connector.
2

Load the connector

Load the FlexiCaptureConnector.jar file on to the server.
3

Restart the server

Open the Pega Self-Service Portal and click Restart Server.
Screenshot of the Pega Self-Service Portal Operations page with the Restart Server button highlighted to restart the application server.

Create a Java function in Pega

The function calls methods from the connector classes.
1

Create a library

  1. Click Records → Technical → Library → Create.
  2. Name the library, for example FlexiCaptureLibrary.
  3. Include the java.util.*, java.nio.file.*, com.abbyy.connectors.*, and com.abbyy.connectors.models.* packages.
Screenshot of Pega Dev Studio editing the FlexiCaptureLibrary record on the Packages tab, listing the java.util, java.nio.file, com.abbyy.connectors, and com.abbyy.connectors.models packages to include.
2

Generate the library

Click Save, and then click Generate Library.
3

Create the function

  1. Click Records → Technical → Function → Create.
  2. In the Label field, provide a name for the new function, for example CaptureData.
4

Specify the input parameters

In the Parameters section, specify the following two input parameters:
5

Select the library

In the Library field, enter the name of the library you created, and then click Create and open.
6

Set the output data type

In the window that opens, on the Parameters tab, specify String as the data type in the Java data type field.
Screenshot of Pega Dev Studio on the function Parameters tab, showing the FileName and Base64Content String input parameters and String selected as the Java data type in the Output section.
7

Add the function code

Copy the code from the CodeExample.java file and paste it on the Java tab of the same window.The file is in this folder:
The sample code is reproduced in Sample function code.
8

Declare the thrown exception

Click the Imports & Exceptions tab and type Exception in the Exceptions thrown section.
9

Generate the function

Go back to the Java tab, select the Function ready to be compiled? option, save your changes, and then click Generate function.A successful generation shows an acknowledgement with a Good status.
Screenshot of a Pega Library Acknowledgement dialog with a Good status and the message that the Library has been generated successfully.

Sample function code

This code sends files to ABBYY FlexiCapture and gets the processing results back as JSON strings holding the names of the captured fields and their values. Replace the placeholder connection values with the data required to connect to your ABBYY FlexiCapture Application Server: the server address, the company name if you use ABBYY FlexiCapture Cloud or a tenant, the user credentials, and the project name. Each one is marked by a comment in the code.

Next steps

Upload your project to the ABBYY FlexiCapture Application Server, and then configure it. For more information, see Configure ABBYY FlexiCapture for the Pega connector.