Knowledge Base

Article ID: 1297 | Category: Project Setup | Type: FAQ | Last Modified: 7/15/2013

Advanced workflow. Conditions for sending documents from stage to stage

Available downloads

Description

How do routing conditions help to customize the workflow? How can you setup routing scripts?

Solution

With conditions, you can set up complex workflows. For example, you can specify to which stage your documents should be sent depending on the results of the previous stage. One of the most typical uses of such conditions is to specify a threshold for unreliably recognized characters and then send only those documents to the Verification stage where the percentage of characters need verification is equal or less than this threshold.

Advanced workflow options (for more information about the advanced workflow see this article) allow you to specify conditions for sending documents to almost any stage (there are a few exceptions, which are described below) and the route which the documents should follow next. You can select the desired options on the Enter Conditions and Exit Routes tabs of the Workflow Stage Properties dialog box. Let us examine the options available on these two tabs.

1)     Enter Conditions

On this tab, you can specify when documents should be admitted to a particular stage. This option is available for all types of processing stage with the exception of the Processed and Exceptions stages. That is, if a document has been sent, for whatever reason, to the Exceptions stage, it should always arrive there. Likewise, if the processing of a document has been completed, it should always arrive at the Processed stage.
As you can see in the screenshot above, there are three possibilities. Documents can be admitted to a particular stage:

If you select “always” for a particular stage, it will accept and process all documents routed to it.

If you select “never” for a particular stage, your documents will simply skip this stage and go on to the next one specified in the routing schema. This option can be selected, for example, for the Rescanning stage, if documents should arrive there only when they are deliberately sent there by, say, a verification operator.

If you select “under [these] conditions” for a particular stage, a document will be admitted to this stage only if certain conditions are met. Otherwise, the document will skip this stage and go on to the next one specified in its routing schema. For example, certain conditions are nearly always specified for the Data Verification stage: before a document is admitted to this stage, the system checks if there are characters or rule errors that need to be verified. If the answer is “No,” the document will skip this stage. Some default conditions of this kind have already been provided for the Verification and Data Verification stages. Later in this document we will describe the types of rules that are used as conditions.

If you select “never” or “under [these] conditions” for a particular stage, you will see a blue circle next to the stage in the list of stages:

 

In the example above, “never” has been selected for a Rescanning stage and “under [these conditions” has been selected for a Verification stage.

2)     Exit Routes

On this tab, you can specify how the program should decide on the next stage to which to send the documents. The “next stage” option is available for all stage types except Exceptions, Rescanning, and Processed (because there can be no processing after the Processed stage, the Rescanning stage should always be followed by the Recognition stage, and at the Exceptions stage it is the operator that decides on the next stage to which to send the batch).

As you can see in the screenshot above, there are two ways for the program to decide on the next stage: 

If the second option is selected (i.e. custom), after the processing at the current stage completes, the program will send the document to the next stage specified by the user, regardless of the stages order specified in the routing schema. And then the document will be processed in accordance with the routing conditions specified for this stage. To specify a custom next stage, the user simply selects it from the drop-down list:

 

This method of specifying the next stage can be used, for example, in complex processing scenarios where at some point the processing options branch out but finally the documents must all arrive at one and the same stage. The screenshot below illustrates one such scenario. In this scenario, documents are sent to different Recognition stages in accordance with their class, but finally they all arrive at the Verification stage.  For the Recognition Others stage, the Verification stage has been specified as the next stage as described above. 

Additionally, you can specify a list of stages to which documents should be sent if certain conditions are met:

 

The program will first check these conditions, and if none of them is met, the program will select the next stage according the user specified option — “routing schema” or “custom stage.”

By default, the Exceptions stage is available in this list for each of the stages, with the following condition: if a task WASN’T processed successfully at the current stage, the batch is sent to the Exceptions stage.

In order to add a stage to this list, click the Stage… button to the right. In the Next Stage dialog box, select the required next stage and specify the required conditions:

 

Once added, stages can be edited or removed from the list, and their order in the list can be changed. The order of the stages determines the order in which their corresponding conditions are checked (the program will start from the topmost stage).

To create conditions for sending documents to a particular stage, click the Rule… button. Once created, rules can be edited or removed from the list, and their order in the list can be changed. The order of the rules determines the order in which they are checked. Rules can be grouped together. We will discuss the types of rules and groups later on in this document.

Routing rules

We have already said that for each stage we can specify rules, or conditions, that will determine which documents will be admitted to the stage and to which stage the documents will be sent afterward.

There exist two types of rule:

Standard rules are used to specify simple conditions which determine whether a stage admits a document or not. Examples of conditions to be met:

When creating a standard rule, the user selects required conditions from a list. In the example above, a standard rule has been used to send documents to the Exceptions stage.

Scripts are used to specify complex conditions for sending documents to this or that stage. These conditions may use field values and registration parameters of a document or batch. A script works with individual documents, so the program cannot “look into” the neighboring documents. For example, you can create a script that will admit only those documents to the given stage for which a particular registration parameter has been specified.

Starting from release 4, a comment can be added to a batch from a stage rule script (this comment gives the reason for sending the batch to this particular stage). However, no other batch data can be changed with a stage rule script. For example, you cannot add registration parameters, change field values, etc. (If required, you can change batch data at the scripting stage.) If an error occurs when running a stage rule script, the documents are sent to the Exceptions stage.

Apart from creating separate rules, you can also group rules together. For each group of rules, you can specify the condition under which it is implemented: either when any one rule is implemented or all rules are implemented. Grouping rules together makes it easier to specify conditions for sending documents to this or that stage. Instead of creating one very complex rule, you can create a group of several simple rules. In a group of rules, the logic of the conditions is more apparent (particularly if the rules have been given meaningful names) and can be adjusted more easily.

Consider this example. Before sending documents to the Verification stage, a number of checks have to be done — the program needs to check if there are characters or fields that need verification, or if there have been any rule or assembly errors. It makes sense to create a separate rule for each of the checks and then put them into one group, which will be implemented if at least one of its rules is implemented:

In the RoutingScripts.rar archive you can find 2 sample projects:

411 people think this is helpful.
Was this information helpful to you?