Skip to main content

ABBYY Cloud Sync

The ABBYY Cloud sync services are a set of three micro services that handle the moving of documents from a local storage location to and from an ABBYY Distributed install (primarily ABBYY Cloud). The code can be found [here](https://dev.azure.com/WorkflowDoctor/WFD.Abbyy.Services).

Input Service​

The input service is the primary entry route into the sync service, it support both HTTP POST request to /api/input and folder monitoring using a folder location defined in the appsettings.json file. Once the file has been received it is published through an EventBus to notify subscribers that there is a 'NewBatch'.

Recognition Datastore​

The recognition data store keeps track of all documents and data sent to and from ABBYY Flexicapture. It is a simple RESTful CRUD API that acts as a data access layer. Currently, the only supported database provider is MongoDB.

Recognition.SendToOCR​

The SendToOCR worker handles the interactions with ABBYY Flexicapture, both to send documents up and retrieve them once processed. It listens for any NewBatch events, stores the data in the database and then sends the documents up to ABBYY Flexicapture. 

The service monitors that all files have been received into ABBYY, and can send notification emails if anything fails. This is useful for password/content protected files as the ABBYY SOAP API accepts all files regardless of protection level,

The service also checks for any batches that are at the 'Processed' stage. Currently, there is no way to access ABBYY Document field data directly from the SOAP API. **`Any data that needs to be returned from ABBYY Cloud MUST be stored in a document property named 'Results'. **For clarification, this is the code snippet that retrieves data from ABBYY.

var batchDocuments = await batchResource.GetBatchDocumentsAsync(Int32.Parse(batchId));

foreach (var document in batchDocuments.Where(doc => doc.Id > 0)) // batchDocuments is a List { var results = document.Properties.FirstOrDefault(p => p.Name == "Results");

foreach (var page in document.Pages)
{
if (processedData.ContainsKey(page.SourceDetails) == false)
{
processedData.Add(page.SourceDetails.ToString(), results.Value);
}
}

}

Installation Instructions

Pre-Requisites​

.NET Core Hosting Bundle - [https://dotnet.microsoft.com/download/thank-you/dotnet-runtime-2.2.7-windows-hosting-bundle-installer](http://0776925827)

Erlang - [https://www.erlang.org/downloads](https://www.erlang.org/downloads) 

RabbitMQ Event Bus - [https://www.rabbitmq.com/download.html](https://www.rabbitmq.com/download.html) 

MongoDb Server - [https://www.mongodb.com/download-center/community](https://www.mongodb.com/download-center/community)

  • Ensure all pre-requisites are installed before starting
  • Navigate to [https://dev.azure.com/WorkflowDoctor/WFD.Abbyy.Services/_machinegroup?view=MachineGroupView&mgid=491&tab=Machines](https://dev.azure.com/WorkflowDoctor/WFD.Abbyy.Services/_machinegroup?view=MachineGroupView&mgid=491&tab=Machines) 
  • Press the Register button on the far right of the page
  • Tick the 'Use a personal access token in the script for Authentication' checkbox and press Copy script to Clipboard
  • Open Powershell on the server you wish to install on (as administrator) and run the copied script
  • When asked to enter DeploymentTags type DeployLive
  • When asked to enter credentials, leave as default
  • Return to [https://dev.azure.com/WorkflowDoctor/WFD.Abbyy.Services/_machinegroup?view=MachineGroupView&mgid=491&tab=Machines](https://dev.azure.com/WorkflowDoctor/WFD.Abbyy.Services/_machinegroup?view=MachineGroupView&mgid=491&tab=Machines)  and ensure the new server appears in the list and shows as online
  • Navigate to [https://dev.azure.com/WorkflowDoctor/WFD.Abbyy.Services/_release?_a=releases&view=mine&definitionId=5](https://dev.azure.com/WorkflowDoctor/WFD.Abbyy.Services/_release?_a=releases&view=mine&definitionId=5)
  • Go to the 'Release Input Service' and press Create Release - Ensure the latest non alpha build is selected from the version dropdown
  • Go to the 'Release Recognition Services' and press Create Release - Ensure the latest non alpha build is selected from the version dropdown
  • Once both releases have finished navigate back to the Client server, there will be new folders under C:\wfd\Services containing the 3 deployed services
  • Go into each one individually, rename appsettings.development.json to be appsettings.json
  • Edit the appsettings file and ensure all required settings are populated correctly