Zone Operations Section

In Smart Forms Extender, we can attach custom operations to zones and templates to handle more complex form processing scenarios. Using zone/template operations we can express every form processing scenario also possible with the Form Processing Extender and much more.

For example, Split on Matched Templates, Remove Matched Templates, Treat Unmatched Pages as Exceptions and Treat Low Confidence Pages as Exceptions can be configured using operations as well.

An operation describes what should happen (action) and when it should happen (condition). For example the configuration of Split on Matched Templates feature using operations would look like this:

if template matched then start new document from this page. The possibilities are limited only by the available conditions and actions (listed below).

Adding a new operation is possible by pressing the Add button or selecting some condition and action from the combo boxes.

Operations work the following way: they evaluate the selected condition and if the condition is fulfilled, they perform the selected action. The number of operations is not limited per zone or template. If more than one operation is defined then Smart Forms Extender processes them in their order (from top to bottom). To control the order of execution, you can Move up or Move down the selected operation in the list. It is also possible to remove the selected operation or remove all of them.

Currently, the following conditions are available:

  • if page contains low confidence zone: this condition is met when the matched page contains at least one zone that was marked with Low Confidence error.
  • if RegExp matches zone value: this condition is met if the zone value matches the specified regular expression. This condition can be defined for zone operations only. In case of template operations this condition is not interpreted since it is not defined which zone value should match the regular expression.
  • if SQL query contains zone value: this condition is met if the result of an SQL query contains the zone value. When the SQL query returns more than one column then Smart Forms Extender looks for the zone value in the first column. The search for the zone value in the result uses case insensitive string compare.

    This condition can be defined for zone operations only. In case of template operations this condition is not interpreted since it is not defined which zone value should be included in the result of SQL query.

  • if template matched: this condition is met when the template matched on a page

The list of available actions is the following:

  • accept zone value: this action accepts the zone value when the related condition is met. When the condition is not met the zone is marked with Filter failed error. Later, this error is displayed at the validation screen (if defined) to inform the user that the value of the zone maybe wrong and needs to be reviewed.
  • export page to exception folder: this action copies the currently processed page to the defined exception folder and removes this page from the output document.
  • finish current document at this page: this action starts a new document from the next page. The currently processed page is the last page of the previous document. This is a new feature as splitting previously could start new document only from the matched page.
  • reject zone value: this action is contradictory to the accept zone value action. If the related condition is met, the zone is marked with Filter failed error otherwise no error is indicated.
  • remove this page: this action removes the currently processed page from the output document.
  • replace substring in zone value: this action replaces a substring in the zone value where the specified regular expression matches the zone value. The replacement happens at every matching substring.
  • search for substring in zone value: this action selects the first occurrence of a substring from the recognized zone value. The substring is selected where the specified regular expression matches the zone value (This action can be used to achieve similar functionality as in case of Search Zones in the FPE).
  • skip subsequent pages: this action skips some of the following pages from form processing to increase processing performance. For example, if we know that every 10th page matches a template then it is completely unnecessary to perform the template selection process for every page since only every tenth matches the template. All we need to do in this case is add this action and specify the number of pages to skip (9 in this case).
  • start new document from this page: this action starts a new document (aka. batch) from the currently processed page. The first page of the new document is the currently processed page. The finish current document at this page action is quite similar. The only difference between them is the first page of the new document.

Some of the previously mentioned conditions and actions have additional parameters that can be changed by pressing the Edit button in the same line where the condition and action were selected in the operations list.

'If RegExp matches zone value' parameter

After you pressed the Edit button for an operation where the if RegExp matches zone value condition was selected, the Operation editor dialog appears where additional condition and action parameters can be defined.

Only the regular expression must be defined for this condition. By default, the regular expression is .+ which matches everything. In order to make the regular expression editing easier, you can specify an arbitrary test string on which the regular expression is tested in real-time. When you change the regular expression or the test string, the editor automatically highlights all matching substrings in the test string. Every match is colored with alternating colors of yellow and green to make it easier to notify all matching substrings.

'If SQL query contains zone value' parameter

When using the SQL query based condition, the editor presents a dialog, where you can configure the SQL connection, edit the query and test the result.

First, you need to specify the connection string for the data source. To do this, use the standard Data Link Properties dialog of OLE DB.

Always enable the Allow saving password check box, otherwise the SQL connection does not work. The password is stored in the database using standard ShareScan encryption technique.

After the connection is configured, you can edit the SQL query and verify it at the Test SQL query tab. By pressing the Test button, the SQL query is performed and the result list appears. If the specified value is in the list, then the matching is indicated, otherwise pressing the Test button informs you that no matching value found.

'Replace substring in zone value' parameter

When you select the replace substring in zone value action, you need to define which part of the zone value should be replaced with a specified text. To do this, click on the Edit button for the proper operation and specify the Expression in the bottom panel. This regular expression is tested with the recognized zone value during form processing and every match is replaced with the string defined at the Replace matching substring with text box. For example, the image below shows a scenario, where all 0 digits of an invoice number are replaced with 1. Later, at the validation screen the modified zone value is displayed and stored in the data publishing key.

'Export page to exception folder' parameter

When using the export page to exception folder action, you can either export the pages to the exception folder defined at the administration UI of Smart Forms Extender (default), or you can use a custom exception folder by checking the Use custom exception folder check box. In this case, the path to the exception folder must be defined along with a user credential that is used to access the specified folder (the user must have write access for the folder). If the credential is not populated, then the Network Service account is used (or the one which runs the Manager).

The password of the user credential is stored with encryption in the ShareScan database using the standard encryption technique.

'Skip subsequent pages' parameter

When the skip subsequent pages action is used, you can specify the number of pages to skip (default is 1). If the related condition is met, then some of the following pages can be skipped during form processing in order to increase processing performance.

Advanced Template Properties

Similarly to the advanced zones properties, you can specify ShareScan related parameters for templates as well. To do this, select the template in the tree and click on the '...' icon beside the Advanced settings property in the property grid (as in case of zone advanced settings). Press the button to reveal the Advanced template properties dialog.

It is very similar to the Advanced Zone Properties dialog. The only difference is that the zone specific parameters are not displayed, but you can define custom operations for the template as in case of zones. Everything works the same way but the list of conditions/actions contain only the items independent of zones.

List of available conditions:

  • if template matched: this condition is met when the template matched on a page.
  • if page contains low confidence zone: this condition is met when the matched page contains at least one zone that is marked with Low Confidence error.

List of available actions:

  • export page to exception folder
  • finish current document at this page
  • remove this page
  • skip subsequent pages
  • start new document from this page