Processing Status, Cancellation, and Timing
Processing Status
The processor class raises status events through the ProcessImageProgressChanged event. Status events give an estimate of the percentage of processing that is complete. Since processing only accepts one image at a time, the progress events are relative to the completeness of processing one image.
A progress event will occur after form identification is complete and then only after processing of a field has completed. However, a progress event will not occur after every field has completed processing, progress events only occur with a maximum frequency of 2 per second.
- In the serial field processing scenario, the ProcessImageProgressChanged event handler will block other fields from being processed.
- In the parallel field processing scenario, other fields will be processed as the event handler executes.
Cancellation of Processing
The progress events also provide the mechanism through which processing of an image can be canceled. The event handler should set the ProcessImageProgressChanged.Cancel property to true.
- In the serial field processing scenario, once the event handler returns with Cancel set to true, no more field processing will take place and the FormResult object will indicate that processing was canceled.
- In the parallel processing scenario, all fields may complete processing by the time the event handler returns with Cancel set to true. But if the event handler returns first, processing of any field will be stopped as soon as possible. In both cases the FormResult object will indicate that processing was canceled. There is no guaranteed state for FieldResult objects corresponding to fields that were being processed when the cancellation request was made.
Timing of Processing
The processor has mechanisms built in to time its various operations. These mechanisms cannot be disabled, but their cost is trivial. The results of timing are returned in two classes, the FormTimingResult and the FieldTimingResult.
Exceptions during Processing
- Exceptions that occur during form level processing (i.e. full image cleanup, image identification, and image alignment) indicate that processing of the image cannot continue. These exceptions will be passed up to the calling code to handle as needed.
- Exceptions that occur during field level processing are not expected to affect other field processing. These exceptions are caught and put in the FieldException property of the FieldResult object produced for that field.