Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt

Use this file to discover all available pages before exploring further.

Instead of using the IF activity, you can create a workflow item containing two Extraction Rules activities and select the “Layout” field as a source field so that its values serve as conditions for choosing which activity will be applied to each document.
The IF activity routes documents to the correct Extraction Rules activity based on classification result. The processing flow is in place — now define the condition for each branch.
1

Select the IF activity

Click the IF activity in the workflow.
2

Open the Sick Note DE case condition

In the Case Conditions section of the Activity Properties pane, click the settings icon next to the “Sick Note DE” activity.
3

Add the script for the DE branch

The IF activity uses a script to select the next activity based on the document class determined by the Classify By Text and Image activity. The classification result is recorded to the “Layout” field, whose possible values are the names of the classes created in the Classify By Text and Image activity.Paste the following script to the script editor to forward all documents of class “DE” to the “Sick Note DE” activity:
for (var i = 0; i < Context.Transaction.Documents[0].Fields.length; i++)
{
    if (Context.Transaction.Documents[0].Fields[i].Name === 'Layout' && Context.Transaction.Documents[0].Fields[i].Value === 'DE')
    {
        return true;
    }
}
return false;
Click Save.
4

Add the script for the BE branch

Click the settings icon next to the “Sick Note BE-NL” activity and paste the following script in the script editor:
for (var i = 0; i < Context.Transaction.Documents[0].Fields.length; i++)
{
    if (Context.Transaction.Documents[0].Fields[i].Name === 'Layout' && Context.Transaction.Documents[0].Fields[i].Value === 'BE')
    {
        return true;
    }
}
return false;
Click Save.
If the document is of an unknown class or if the “Layout” field doesn’t exist (which means the document couldn’t be processed by the classification activity), it will be forwarded directly to Fast Learning.
If you want to try and extract data from a document even if its class could not be determined, you can create a special Extraction Rules activity for documents with no class or forward them to one of the existing Extraction Rules activities.

What’s next

Step 5. Configure the Fast Learning activity

Define the data form, label fields on German sick notes, and train the Fast Learning activity.

Tutorial overview

Back to the tutorial introduction.