Import the connector to the Pega server
1
Open the Import wizard
Open Dev Studio and click Configure → Application → Distribution → Import.

2
Load the connector
Load the
abbyy.flexicapture.webapi.client.jar file on to the server.3
Restart the server
Open the Pega Self-Service Portal and click Restart Server.

Create a library
1
Start a new library
Click Records → Technical → Library → Create.
2
Name the library
On the Create Library tab, specify a name for the library in the Label field, for example 
ABBYY, and fill in the Identifier field.Make sure that the library is being created within the context of your application, and then click Create and open.
3
Add the packages
On the Packages tab, add the following packages:
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.*

4
Create the static variables
On the Static Variables tab, create the following string variables:
baseUritenantNameuserNamepasswordmultiFileProjectNamesingleFileProjectName

5
Generate the library
Click Save, and then click Generate Library.
Create a function
A function holds Java code that runs when the function is called from other Pega objects. Specify the input and output parameters on the Parameters tab, and the exceptions on the Imports & Exceptions tab.1
Start a new function
Click Records → Technical → Function → Create and fill in the Label and Identifier fields.
2
Select the library
In the Library field, specify the name of the library you created earlier.
3
Specify the input parameters
In the Parameters section, specify the following two input parameters:
4
Create the function
Make sure that the function is being created within the context of your application, and then click Create and open.

5
Set the output data type
In the window that opens, on the Parameters tab, specify 
int, string, or boolean as the data type in the Java data type field.
6
Declare the thrown exception
Click the Imports & Exceptions tab and type 
Exception in the Exceptions thrown section.
7
Add the code and generate the function
Go back to the Java tab and insert the code for the function in the Java source field. Select the Function ready to be compiled? option, save your changes, and then click Generate function.

