Importing a connector to the Pega server
To import the connector to the server:- Open Dev Studio and click Configure → Application → Distribution → Import.

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

Creating a library
To create a library:- Click Records → Technical → Library → Create.
- In the Label field of the Create Library tab, specify a name for the library (e.g. 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.

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

- On the Static Variables tab, create the following string variables:
- baseUri
- tenantName
- userName
- Password
- multiFileProjectName
- singleFileProjectName

- Click Save and then click Generate Library.
Creating a function
A function contains Java code that is executed when the function is called from other Pega objects. The input and output parameters of a function are specified on the Parameters tab, while exceptions are specified on the Imports & Exceptions tab. To create a function:- Click Records → Technical → Function → Create and fill in the Label and Identifier fields.
- In the Library field, specify the name of the library you created earlier.
- In the Parameters section, specify the following two input parameters:
| Name | Java type |
|---|---|
| FileName | String |
| Base64Content | String |
- Make sure that the function is being created within the context of your application and click Create and open.

- In the window that opens, on the Parameters tab, specify int, string or boolean as the data type in the Java data type field:

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

- Go back to the Java tab, insert the code for the function in the Java source field, select the Function ready to be compiled? option, save your changes, and click Generate function.
The code for the function can be copied from the java file, which you can find in %Installation Path%\Connector for FlexiCapture as a Service with verification\Samples\Code examples\Pega Functions.

- Create a set of functions to be used for the processing of a single document.
- Create general functions.
- Create a single-document processing case.
- Configure the user interface.
- Create a set of activities for your single-document processing case.
- Create a set of data transforms for your single-document processing case.
- Create a flow action.
- Create data types for your single-document processing case.
- Create a set of functions to be used for the processing of multiple documents.
- Create general functions.
- Create a multi-document processing case.
- Create HTML fragments.
- Create a set of activities for your multi-document processing case.
- Create a set of data transforms for your multi-document processing case.
- Create a flow action.
- Create data types for your multi-document processing case.
