All Classes Namespaces Functions Properties Pages
Capture SDK Samples

This page explains how to import the Capture SDK Sample Package, run the included processes, and view the associated sample code. (Note that this sample package is not designed for a Microsoft Azure or an OPMT installation of TotalAgility.)


The Package and Related Contents


The sample package, code, and sample images can be found in the Capture SDK Sample Package folder under the KTA installation's Sample Processes folder.

The Capture SDK Sample Package folder contains the following:

  1. Capture SDK Sample Package.zip - The sample KTA package, which will be imported.
  2. Kofax.TotalAgility.Sdk.Samples - Contains the SdkSamples Visual Studio 2013 solution that contains the CaptureDocumentServiceSample class library project for generating the DLL referenced by the process maps. This solution contains the sample code for calling common CaptureDocumentService API methods and is the actual code used by the processes.
  3. Sample Images - The image files used by the sample processes.

Deploy


Package

The Capture SDK Sample Package.zip file should be imported using the Packages screen, which is accessible from the TotalAgility Designer screen. After navigating to the Packages screen, click on the Import Package button. Use the Import Package screen to browse to the Capture SDK Sample Package.zip file and import it. It should import all process maps, forms, document and folder types, and the custom DLL needed by the process maps.

Sample Images

The Sample Images folder should be placed directly on the TotalAgility application server's C: drive. If this is not possible, then the file path process variables (FilePath1, FilePath2, and FilePath3) in the Capture SDK Samples process map, which is imported as part of the sample package, should be updated with the custom path to the Sample Images folder.


The Processes


The package includes the following two process maps: Capture SDK Samples and Capture SDK UI Test.

Capture SDK Samples

The Capture SDK Samples process map includes .NET activity nodes within embedded processes that call the sample methods in the CaptureDocumentServiceSample class library that is part of the SdkSamples Visual Studio solution. It is a non-interactive process map that demonstrates how to reference and use the sample methods in the class library using .NET activity nodes. The process map is structured with the embedded processes as follows:

Capture SDK UI Test

This process map includes an Ordinary Activity form with fields that accept a path to an image file on the TotalAgility application server. It also contains the image mime-type, and a button to initiate a form action. The form action uses this information to call the CaptureDocumentService API method SavePageImage using the SavePageImageSample method (which is in the CaptureDocumentServiceSample class library).


Run the Processes


Capture SDK Samples

The Capture SDK Samples process can be launched by logging into the Work Queue and navigating to the Jobs menu and selecting "Create".

On the Jobs - Create form, select the "SDK Samples" category and then select the "Capture SDK Samples" process. Click the Create button to create a job using this process map.

CaptureSdkJobsCreate1.png

After the job is created, navigate to the Jobs menu and select "Find" to list all jobs that are in the Live state. (Note: If the job that was just created is not displayed, it may have finished running. The Editor can be used to list all Live and Finished jobs.)

Locate the job that was just created. After the status of the job becomes "Completed", you can see the final values of the process variables associated with the job. It should be similar to the screenshot below:

CaptureSdkVariables.png
Capture SDK UI Test

You can launch the Capture SDK UI Test process by logging into the Work Queue, navigating to the Jobs menu, and selecting "Create".

On the Jobs - Create form, select the "SDK Samples" category and select the "Capture SDK UI Test" process. Click the Create button to create a job using this process map.

CaptureSdkJobsCreate2.png

Return to the Work Queue and locate the "Test API Methods" activity that is associated with the job.

Open the activity and view the form. It provides a file path and a mime type field. Populate the fields with a path to an image file which is located on the application server, and the image mime type.

Then click on the "Call SavePageImage" button and it will save the image in the TotalAgility repository using the CaptureDocumentService SavePageImage API method through a form action. The API method is called indirectly using the SavePageImageSample method of the CaptureDocumentServiceSample class library.

CaptureSdkTestApiMethodsForm.png

The SdkSamples Solution


The SdkSamples Visual Studio 2013 solution contains the CaptureDocumentServiceSample class library used by the package. It contains the following methods that call corresponding CaptureDocumentService API methods:

The sample code demonstrates usage of the API methods and includes comments to help clarify the steps that are taken.

Building the solution outputs an assembly named "CaptureDocumentServiceSample.dll" that you can add to a TotalAgility instance using the .Net Assemblies screen that is under the Integration screen of the Designer.