Skip to main content
To enable a custom Appian application to interact with the ABBYY FlexiCapture Connector for Appian, create several entities. This page describes the two AFC expression rules and the two Web API methods that the connector requires. For the remaining entities, see Modify the ABBYYFlexiCapture application.
Before you create these entities, make sure the ABBYYFlexiCapturePlugin.jar plugin is installed on the Appian server. To install it, copy the plugin from the connector distribution package into the APPIAN_INSTALL/_admin/plugins/ folder.
Create the following entities in order:
  1. Create a data type.
  2. Create a data source.
  3. Create a data store.
  4. Create a record type.
  5. Create a constant of type Data Store Entity to link the data store to the data type.
  6. Create an AFC_GetConstantDSEByRecordTypeName rule that returns a constant of type Data Store Entity.
  7. Create an AFC_GetDataTypeByRecordTypeName rule that returns the full name of the data type.
  8. Create a folder of type Knowledge Center to store the processed files received from ABBYY FlexiCapture.
  9. Create the UploadDocument Web API method to add a new document to the knowledge center.
  10. Create the CreateRecord Web API method to populate the database table.

Create an AFC_GetConstantDSEByRecordTypeName rule

The CreateRecord method of the Web API requires a rule that returns a constant of type Data Store Entity. This rule determines the data store and data type where a record is created.
1

Create a new expression rule

In Appian Designer, open the application and click New → Expression Rule.
2

Name and save the rule

Select Create from scratch, complete the Name and Save In fields, and click Create & Edit.
3

Add the RecordTypeName input

In the Rule Inputs dialog box, click the + icon and add an input variable of type Text named RecordTypeName.
4

Paste the expression

In the code editor on the left, paste the following expression:
If the RecordTypeName input matches the name of a stored record type (in the plural), the rule returns the Data Store Entity constant that links the data store and the data type.

Create an AFC_GetDataTypeByRecordTypeName rule

The CreateRecord method of the Web API requires a rule that returns the full name of the data type.
1

Create a new expression rule

In Appian Designer, open the application and click New → Expression Rule.
2

Name and save the rule

Select Create from scratch, complete the Name and Save In fields, and click Create & Edit.
3

Add the RecordTypeName input

In the Rule Inputs dialog box, click the + icon and add an input variable of type Text named RecordTypeName.
4

Paste the expression

In the code editor on the left, paste the following expression:
If the RecordTypeName input matches the name of a stored record type (in the plural), the rule returns a string with the full name of the data type. Otherwise, it returns null. To find the namespace, open the data type in the ABBYYFlexiCapture application, and then click the name of the data type in the top-left corner to open the Data Type Properties window.

Create the UploadDocument Web API method

1

Create a new Web API

In Appian Designer, open the application and click New → Web API.
2

Name the Web API

Enter UploadDocument in the Name and Endpoint fields, change HTTP Method to POST, and click Create & Edit.
3

Paste the code

Close the template selection dialog box, and then paste the following code into the code editor:
The uploaddocument(String query) method appears in the code editor only if the ABBYYFlexiCapturePlugin.jar file is in the APPIAN_INSTALL/_admin/plugins/ folder. This method sends a JSON string with the file contents directly to the Java method you created and returns a JSON string with the ID of the folder where the document was placed.

Create the CreateRecord Web API method

1

Create a new Web API

In Appian Designer, open the application and click New → Web API.
2

Name the Web API

Enter CreateRecord in the Name and Endpoint fields, change HTTP Method to POST, and click Create & Edit.
3

Paste the code

Close the template selection dialog box, and then paste the following code into the code editor:
  • rule!AFC_GetDataTypeByRecordTypeName(http!request.queryParameters.RecordTypeName) accepts a parameter with the name of the record type (received by the Web API method from the ABBYY FlexiCapture Connector for Appian) and returns the full name of the data type.
  • rule!AFC_GetConstantDSEByRecordTypeName(http!request.queryParameters.RecordTypeName) returns the Data Store Entity constant.
4

Add the query parameter

  1. In the right-hand pane, click the New Query Parameter button and add a parameter named RecordTypeName to the query string.
  2. Select the Set as default test value option and click Save.