Skip to main content
This section describes the modifications you can make to the sample ABBYYFlexiCapture application. To be able to store a different type of documents in the application, you need to create a new record type and make some other changes.

Creating an infrastructure for storing and displaying data in Appian

The purpose of a record type is to display information from data store in Tempo. Therefore, you need to create an infrastructure for storing and displaying data in Appian. To do this:
  1. Create a database table (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 and the data type.
  6. Edit the AFC_GetDataTypeByRecordTypeName and AFC_GetConstantDSEByRecordTypeName rules.
  7. Create a folder of type “Knowledge Center” where to store processed files received from ABBYY FlexiCapture.

Creating a data type

  1. In Appian Designer, open the ABBYYFlexiCapture application and click New → Data Type.
  2. Select Create from scratch, complete the required Name field, and click Create & Edit.
  3. In the dialog box that opens, create database table fields by clicking the New Field button. The ABBYY FlexiCapture Connector for Appian will be populating this table with data and then the record will be loading data from this table into Appian.
    Important! Your table must contain a primary key field named “FolderId” of type “Number(Integer).” This field will function as a unique primary key and will link the data in the table with the knowledge center folder.
  4. Before the data type table in Appian can accept table rows from ABBYY FlexiCapture, you must create an auxiliary data type for fields corresponding to table columns in the Document Definition. Next, create a field in the data type, specify the name of the auxiliary data type as its type, and select the Array option.
  5. When you have made all the necessary changes to the table, click Save.

Creating a data source

  1. Open the Appian Administration Console and click Data Sources in the Integration section on the left.
  2. On the Data Source Management page that opens, click New Data Source.
  3. In the Configure Data Source dialog box, complete the following required fields:
    • Name – a name for the new data source (e.g. jdbc/Appian);
    • Type – the type of the new data source (e.g. SQL Server);
    • Username/Password – the credentials of the database user;
    • Connection String – the string to be used to connect to the database (e.g. jdbc:sqlserver://appian.company.com:1433;databaseName=appian_db).
  4. Click Test Connection to check that you have entered the correct data. If the test is successful, click Save.

Creating a data store

  1. In Appian Designer, open the ABBYYFlexiCapture application and click New → Data Store.
  2. Complete the Name field and click Create & Edit.
  3. On the Data Management tab of the Data Store editor:
    1. Select a data source.
    2. Click the Add Entity button and add a data type.
    3. Click the Verify button to verify your data store.
    4. Click Save & Publish.

Creating a record type

  1. In Appian Designer, open the ABBYYFlexiCapture application and click New → Record Type.
  2. Complete the Name and Plural Name fields and click Create & Edit.
  3. In the window that opens:
    1. In the Data section, select Data Store Entity and add your data store and your data type.
    2. Configure the display of your record list (see Configuring the record list).
    3. Configure the display of the Summary tab (see Configuring the record view).

Creating a constant of type “Data Store Entity”

This constant links your data store to your data type. When a new record is created, this link is used to determine the record type of the record.
  1. In Appian Designer, open the ABBYYFlexiCapture application and click New → Constant. The constant will be created from scratch and its default type will be Data Store Entity.
  2. Specify a name for your constant. The Data Store and Data Type fields will be populated by the previously created objects.
  3. Save the changes to the default AFC Rules and Constants folder or to any other folder of your choice.

Editing the rules

Once you have added the new record type and constant, you need to modify the expression rule by adding conditions for the new record type.
  1. In Appian Designer, open the ABBYYFlexiCapture application and select the Expression Rule option in the left-hand pane. Locate and click the AFC_GetConstantDSEByRecordTypeName rule to start editing it.
  2. In the code editor, replace “null” with the following “if” condition for the new record type and constant:
if(ri!RecordTypeName == "Account Payable Records",
cons!Constant_InvoiceProsessing_DSE,
if(ri!RecordTypeName == "Credit Card Applications",
cons!Constant_CreditApplication_DSE,
if(ri!RecordTypeName == "New Records", /* In RecordTypeName, specify the name of the new record type in the plural. */
cons!New_Constant, /* After cons!, specify the name of the constant you created earlier. */
null
)
)
)
If an input RecordTypeName is the same as the name of a stored record type (in the plural), the DataStoreEntity constant will be returned that links the data store and the data type.
  1. Now you need to edit the AFC_GetDataTypeByRecordTypeName rule. In Appian Designer, open the ABBYYFlexiCapture application and select the Expression Rule option in the left-hand pane. Locate and click the AFC_GetDataTypeByRecordTypeName rule to start editing it. In the code editor, replace the “null” with the following “if” condition for the new record type and the full name of the data type:
if(ri!RecordTypeName == "Account Payable Records",
'type!{urn:com:appian:types}Invoice_Header',
if(ri!RecordTypeName == "Credit Card Applications",
'type!{urn:com:appian:types}Credit_ApplicationMain',
if(ri!RecordTypeName == "New Records", /* In RecordTypeName, specify the name of the new record type in the plural. */
'type!{urn:com:appian:types}New_Data_Type', /* In the type! field, specify the full name of the data type and the namespace. */
null
)
)
)
If an input RecordTypeName is the same as the name of a stored record type (in the plural), a string will be returned containing the full name of the data type you created (you can look up the namespace in the data type properties). To display the properties of a data type, open the desired data type in the ABBYYFlexiCapture application. Clicking the name of the data type in the top left corner will open the Data Type Properties window where you can see the namespace.

Creating a knowledge center

To store document images in Appian, you need to create a knowledge center folder.
  1. In Appian Designer, open the ABBYYFlexiCapture application and click New → Folder.
  2. Select Knowledge Center as the type for your folder, complete the Knowledge Center Name, and click Create.
The ID of this folder will be passed in the repository field in the ABBYY FlexiCapture Connector for Appian export script settings. When data are exported from ABBYY FlexiCapture, image files will be saved to this folder.
<!--DMS repository name-->
    <Repository>5995</Repository>
You can look up the ID of a knowledge center on the Runtime Data tab of the Knowledge Center Properties dialog box.