Help > Tutorial > An XBOUND tutorial

An XBOUND tutorial

Contents

Chapter 1: Introduction

Chapter 2: Preparation

Chapter 3: Setting up your workspace (a console) in XBOUND

Chapter 4:Processes and clients

Chapter 5: Processing documents

Chapter 6: Working with several processes

Chapter 7: Controlling process flows

Chapter 8: Using barcodes to determine document structure

Chapter 9: Processing documents and media that meet specified criteria

Chapter 10: Splitting documents by document type

Chapter 11: Cleanup: Deactivate or delete the Tutorial

Chapter 12: For a deeper understanding


Chapter 1: Introduction

This introduction is for those who have the task of configuring document processing in XBOUND. You will learn how to define clients and processes, as well as how to control document processing within the processes. Previous knowledge is not required.

You need an installed XBOUND system in order to perform the procedures described here. (See Installing XBOUND.) The Tutorial assumes that no clients or processes have been set up.

Every chapter of this tutorial builds on the previous chapter. In most cases you need the configuration from the previous chapters in order to proceed.

Users who are experienced in the Windows environment can expect to complete this tutorial in 4 to 6 hours.

When there are very special requirements, it can be necessary to extend XBOUND by implementing new functions. For this purpose, XBOUND provides an interface to program (or customize) XBOUND yourself. That is not covered in this tutorial.


Chapter 2: Preparation

  1. While completing this tutorial, we will import a total of five sample batches that are provided in the XBOUND installation. Each batch consists of a directory containing image files and a corresponding trigger file.

    Using Windows Explorer, copy the C:\Program Files\ReadSoft\xbound\Docs\TutorialBatches directory, including all subdirectories and trigger files, to another location in the file system – one where the Windows service XBOUND Collect Service has access (for example to a shared path on a file server).

  2. Change the file extension of the first trigger file (20140313000070.trigger) to rdy. This makes it ready for import into XBOUND.


Chapter 3: Setting up your workspace (a console) in XBOUND

  1. Start the XBOUND Management Center by selecting Start > All Programs > ReadSoft > ReadSoft XBOUND Management Center.

  2. When the Management Center is displayed, you are prompted to add a new console or open an existing one. Click Add a new console.

  3. In the middle pane, click Process Design.

  4. In the right pane, click Create:

  5. In the upper left corner, click Process Design Console and give the console a descriptive name:

    (If the Console pane is not visible on the left, select View > Console view.)

  6. Click the Save button () and save the console wherever you wish.


Chapter 4: Processes and clients

Documents always go through a process. A process is a complete rule specifying what XBOUND does with the documents. Any number of processes can run simultaneously.

In XBOUND, processes can (and must) be created in the context of a client. A client is a logical arrangement of processes that belong together. You could create one client for the processes of a particular customer and another for developing or test purposes, for example.

ClosedExample:

A diagram of the client and two of the processes that are described in the tutorial:

4.1 Creating a client

Right after XBOUND is installed, there are not yet any clients or processes defined. So the first step is to create a client using the Process Designer:

  1. In your new console, select File > New client.

  2. Type Tutorial in the Client name field.

  3. Click OK.

Now you can see the new client in the left pane of the Process Designer.

4.2 Creating a process

Use this procedure to create a process in your new client:

  1. Select File > New process.

  2. In the Client name field, select the client in which the process is to be created (Tutorial).

  3. Type Level1 in the Process name field.

  4. Click OK.

Notice the new process in the left pane of the Process Designer.

4.3 Adding process steps

Documents are processed in multiple process steps within a process. Each process step describes certain operations that are to be performed on the documents.

Let us define a simple process. It will consist of only three steps to process paper documents:

  1. Scan – documents are imported into XBOUND after scanning.

  2. Export – documents are exported from XBOUND into the file system as directories and files.

  3. Delete – processed documents are deleted from XBOUND.

Each of these operations is executed by a particular XBOUND module or activity. (See XBOUND activities: Overview.)

The activities are displayed in the right pane of the Process Designer, which is a kind of toolbox for defining processes. These activities are available for the process steps that we are going to create:

To create a process using these activities:

  1. Click Level1 in the left pane of the Process Designer.

  2. Drag Scan Documents from the right pane (in the Common group) into the middle pane.

  3. Drag Adapter for File System (Structured) activity from the right pane (in the Export Documents group) into the middle pane.

  4. Drag Delete Documents from the right pane (in the Common group) into the middle pane.

  5. Initially, new process steps bear the names of the corresponding activities. It is often useful to provide shorter or more descriptive names:

    1. Right-click the Scan Documents process step and select Rename Process Step.

    2. Type Scan as the new name.

    3. Click OK.

    4. Use the same procedure to rename Adapter for File System (Structured) to Export and Delete Documents to Delete.

4.4 Specifying the process flow

After you create process steps, you must specify the sequence in which they are to be executed. We use process rules to do this. Process rules are displayed as arrows between the process steps.

Link the three process steps with two process rules as follows:

  1. Hold the cursor over the Scan icon until it turns into a hand:

            

    If the cursor will not turn into a hand, make sure that Scan is not selected. Select Delete, for example, and then point to Scan again.

  2. Click and hold while you move the cursor to Export, and release. This creates an arrow between the two processes.

  3. In the same way, create an arrow between Export and Delete.

  4. Save the process by clicking the Save button:

4.5 Configuring process steps

In many cases, the details of the process steps must be configured. The available options depend on which activity you are configuring. (See a list of all activities.) And for a Scan Documents process step, it is important to at least open and close it in order to save the default configuration.

Let us configure our Scan and Export process steps as below:

  1. Double-click Scan.

  2. Click OK to set the default configuration.

  3. Double-click Export.

  4. Set Export path to the directory where you want documents to be exported.

    Tip: When you have questions, you can open XBOUND Help by pressing F1 on your keyboard. You can do this at any time when you are using the program. The help topic describes the specific dialog you are viewing and its settings.

  5. Click OK.

No configuration is needed for Delete.

4.6 Activating the process

The process is now defined, but it is not yet active. This means that no documents can be processed yet in it, and the process is invisible in the Process Monitor (which we will get to shortly).

In the Process Designer, inactive processes are listed with this button by their name:

Activate the process now:

  1. Right-click Level1 and select Activate Process.

  2. Confirm by clicking Yes. The symbol for working processes () is applied, and you can see the process in the Process Monitor.

  3. Save the process by clicking the Save button:

You have just created your first XBOUND process.

4.7 Configuring the collector

XBOUND supports several systems for scanning documents, for example XBOUND Scan Client or scanners of the ImageTrac family. For each system there is a corresponding collector, and each collector must be configured before use.

At this point we will import the first sample batch. It consists of:

Proceed as follows:

  1. Using the Process Designer, select Tools > Collectors > XBOUND Collector for XBOUND Scan Client. We select this particular collector because our sample batch was scanned using XBOUND Scan Client.

  2. In the dialog that is displayed, click the + symbol.

  3. In the XBOUND Scan Client Collector dialog that is now displayed, in the Path setting, specify the location where you copied the sample batches.

    Note: Do not enter the export directory but the directory that contains the sample batches.

  4. Note these settings, which will help you to follow the import while it is happening (see the next section):

  5. Close both dialogs by clicking OK.

4.8 Tracing the import progress

If the service is installed and running correctly, the test batch is imported into XBOUND automatically, typically within a few seconds. You can see this happening in Windows Explorer, when the file extension of the trigger file 20140313000070.* changes from .rdy to .bsy and then to .imp. These file extensions come from the XBOUND Scan Client Collector dialog, and you can specify different extensions if that is helpful.

You can see import progress from the file extension of the trigger file:

.rdy: The batch is ready for import.

.bsy: The batch is being imported right now.

.imp: The import of the batch is finished. The batch is now a root document in XBOUND.

.err: An error occurred while importing the batch. You can find information on the cause of error in the Windows Event Viewer or the log file of the Collect Service.

If the file extension of the trigger file remains unchanged from rdy, ensure that the Collect Service is running and that the application server is configured correctly (see Installing XBOUND).

4.9 Displaying documents, media and fields

We created exactly one root document with our example. Now you can display the root document in the Process Monitor as follows:

  1. First we need to add the Process Monitor to our console. Click Add/remove Plug-Ins () in the upper left corner of the window. The Add or Remove Plug-Ins dialog is displayed.

  2. Select Process Monitor in the left pane.

    Note: If that plug-in is not available there, you must first Closedadd it to the XBOUND Management Center:

    1. Click the New Plug-In button () below the left pane.

    2. Select xboundPlugInProcessMonitor.dll and click Open.

  3. Click the arrow () to move the plug-in to the right pane. The XBOUND Connection Assistant dialog is displayed.

  4. Click Next to use the plug-in's default connection settings.

  5. Click Finish and then OK.

  6. The Process Monitor is now visible in the Console pane (on the left). Save the console ().

  7. Select Process Monitor > Process View.

  8. If it is not selected by default, select Level1 in the middle pane.

  9. Select the Export step in the right pane.

  10. In the lower pane you can now see the document. Click Data, Fields, and other buttons to get an idea of what data is available. (If you do not see those buttons, click this one: )

Tip: Any time your XBOUND process does not work as expected and documents get Error status, a good first step is to click Data in the Process Monitor. The most recent error message is displayed here, regardless of whether the problem is resolved. Checking the error message often leads directly to a solution to the problem.


Chapter 5: Processing documents

Now the documents have been imported by the XBOUND Collect Service and are available in XBOUND for processing. Imported documents are processed in two different ways within XBOUND:

So far, our sample process contains steps that require manual processing. All of the work is performed in the background, by the Windows services.

Start the XBOUND Activities service.

A look in the Process Monitor will show you that our imported document is still waiting at the middle process step of our sample process. To understand why, you must understand how the XBOUND Activities service processes the documents. This is explained in the next section.

5.1 Assigning activities and applications to the XBOUND Activities service

It is possible to run the XBOUND Activities service on one or more computers. You can assign one or more activities to each computer (or service instance, to be more precise) for the documents to be processed on this computer. This allows you to obtain efficient load sharing and optimal utilization of your XBOUND license.

Even if you use the XBOUND Activities service on only one computer, you must assign the activities to it, in order for the documents to be processed by it.

Note: Only automatic activities need to be assigned to the service. The following manual activities do not need to be assigned:

Our sample process contains process steps for importing, saving (exporting from XBOUND), and deleting documents. The import was already taken care of by the Collect Service. Now you must assign Adapter for File System (Structured) and Delete Documents to the XBOUND Activities service so that those activities will run.

5.2 Adding the Assign Activities plug-in to your console

  1. Start the XBOUND Activities service on the desired computer. (ClosedHow?)

    1. Select Start menu > Control Panel > (View By Icons) > Administrative Tools > Services.

    2. In the Services dialog, right-click XBOUND Activities and select Start.

    If an error message is displayed, double-click the service and adjust the settings on the Log On tab.

  2. Return to your Tutorial console. Here we need to add the Assign Activities plug-in.

  3. Click the Add/remove Plug-Ins button (). The Add or Remove Plug-Ins dialog is displayed.

  4. Select the Assign Activities plug-in in the left pane.

    If the plug-in is not available, you must first add it to the XBOUND Management Center (file name xboundPlugInAssignActivity.dll).

  5. Click the arrow () to move the plug-in to the right pane. The XBOUND Connection Assistant dialog is displayed.

  6. Click Next to use the plug-in's default connection settings.

  7. Click Finish and then OK. Assign Activities is now visible in the Console pane (on the left).

5.3 Assigning activities to the XBOUND Activities service

  1. In the left pane, select Assign Activities.

  2. In the middle pane, under Computers and services, find the desired computer and select XBOUND Activities.

  3. In the Adapter for File System (Structured) row, select the box in the Activated column.

  4. In the Instances column, select the number of activity instances to be executed. (For our purposes, one is enough.)

  5. Do those same two steps in the Delete Documents row.

  6. Click the Save button:

5.4 Tracing the processing

When the applications are assigned as described and the XBOUND Activities service is running, all documents are processed by it. In the Process Monitor you can after a short time click Refresh () and see that there are no more documents waiting.

Now you have a working process:

  1. Batches are imported as soon as they are available. This is done by the collector in the Scan process step. (You remember that available batches are recognized by the trigger file).

  2. In our simple process, imported documents are simply saved (exported). This is done automatically (by the XBOUND Activities service) in the Export process step. You specified the export directory, so look in that directory now and see the root document as a directory that contains the images.

  3. When processing is complete, the documents are automatically deleted from XBOUND (by the XBOUND Activities service) in the Delete process step. (We delete processed documents so that they do not clutter up the XBOUND system.)


Chapter 6: Working with several processes

You will rarely run only a single process using XBOUND. It is useful to define several processes, even if you are only developing or testing XBOUND. So let's create a new sample process that will familiarize you with more XBOUND functionality. We will base the new sample process on the existing one, so that you can see how to copy and then build on a process.

It is often useful to copy a process. Let us create a copy of the Level1 process of the Tutorial client, and call it Level2 (still within the Tutorial client).

6.1 Copying a process

  1. Return to the Process Designer in your Tutorial Console. (Select Process Designer in the Consoles pane.)

  2. Select Edit > Copy Processes. The Copy Assistant dialog is displayed.

  3. Select Copy processes to an existing client and click Next.

  4. In Source client, select the Tutorial client.

  5. Select the Level1 process and click Add.

  6. In Destination client, select the Tutorial client again, to create a copy in the same client.

  7. Click Next and then Finish.

  8. The copy is displayed under Process Navigation with the name Level11. Right-click the process and rename it Level2.

  9. Activate the Level2 process. (Right-click it and select Activate Process.)

  10. Save the process by clicking the Save button:

6.2 Importing documents into several processes

In the last section we created a new process called Level2. Now try to import the second test batch of our tutorial into this process:

  1. To prevent the imported batches from being processed and deleted immediately, stop the XBOUND Activities service. (ClosedHow?) At the same time, ensure that the XBOUND Collect Service is still running.

    1. Select Start menu > Control Panel > (View By Icons) > Administrative Tools > Services.

    2. In the Services dialog, right-click XBOUND Activities and select Stop.

  2. Using Windows Explorer, change the file extension of the trigger file ...\TutorialBatches\20140313000071.trigger to rdy.

Watch the trigger file in Windows Explorer. After a few seconds you will see that the file extension of the trigger file changes from rdy to err. The root document cannot be seen in either of the processes in the Process Monitor. Why?

Open the Windows Event Viewer of the computer on which the Collect Service is running. There you will find an error message in Application. It says:

"The root document 20140313000071 matches the process steps Tutorial / Level1 / Scan and Tutorial / Level2 / Scan. Only one match is allowed."

The problem here is that the collector cannot determine which of our two Scan process steps should import the batch. We must define a criterion that allows it to choose the right Scan process step.

You may remember that a document was created for the first batch in XBOUND in our first successful test import. It contained certain fields with information on the scanned batch. These fields (or, to be more precise, the batch information from which the fields are to be created) can be used by the collector as a distinguishing feature to choose the correct Scan process step.

The most flexible criterion to use for selecting the scan process step is the batch name. Let us use that to import both batches into XBOUND.

In the default configuration of the collector for the XBOUND Scan Client, the collector just takes the batch’s 14-digit time stamp (which is also the batch’s directory name) as the batch name.

6.3 Specifying the actual names of the batches to import

  1. Using the Process Designer, select the Level1 process under Process Navigation.

  2. Double-click the Scan process step.

  3. In the Criteria for incoming documents table, click in the Pattern column of the Batch name row and type 20140313000070.

    (Normally we would type a regular expression here that matches all of the batch names that we want to import. However, at the moment we want to import only one batch, so we are entering the actual batch name. Do not be concerned by this at the moment; we will work with regular expressions soon.)

  4. Click OK.

  5. Save the process by clicking the Save button:

  6. Under Process Navigation select Level2.

  7. Double-click the Scan process step.

  8. In the Criteria for incoming documents table, click in the Pattern column of the Batch name row and type 20140313000071.

  9. Click OK.

  10. Save the process.

6.4 Importing the batches

  1. Using Windows Explorer, change the file extension of the two trigger files the two trigger files (20140313000071.imp and 20140313000070.err) to rdy.  This will cause both batches to be imported.

  2. Watch until the trigger files get the file extension imp, which means that the batches have been imported.

  3. Return to the Process Monitor and click Refresh () You can now see both batches, each in its own process.

6.5 Regular expressions

Up to now we have specified fixed criteria. However, you would not want to edit the process steps in the Process Designer for every single batch in a production environment. This is where regular expressions come in.

  1. Using the Process Monitor, select Level1 and then Export to display the imported batch of Level1 process.

  2. The first sheet is a so-called batch header. The barcode printed on this batch header has three parts:

    1. A four-digit code for the client. (We have selected the value 4712 at random. We will link it to the Tutorial client.)

    2. A three-digit code corresponding to the process number. (Level1 will use 001, Level2 will use 002, etc.)

    3. A five-digit sequential number.

    If you scroll down in the image, you can see it written out:

    Note: This barcode configuration is not built into XBOUND, but just an example selected for this tutorial. You can select a completely different barcode structure.

  3. Open the configuration of the XBOUND Scan Client collector again. (Return to the Process Designer and select Tools > Collectors > XBOUND Collector for XBOUND Scan Client.)

  4. Double-click the first line.

  5. The XBOUND Scan Client Collector dialog is displayed. Type ^(\d{12})$ in the Batch pattern box.

  6. Confirm by clicking OK in the two dialogs to close them.

    Now you have configured the collector in such a way that it takes over the batch barcode as root document name. ^(\d{12})$ is a regular expression saying that the barcode has twelve numeric digits that are to be taken as root document name. (ClosedMore details.)

    The individual components of the expression are:

    ^

    Marks the beginning of the barcode. This character should always be set at the beginning of the expression.

    (

    Marks the beginning of the take-over of the following characters into the batch name to be built up. By relocating this bracket you can hide a possibly existing prefix of the barcode, i.e. not take it over to the batch name.

    \d{12}

    Now the 12 numeric digits follow.

    )

    Marks the end of the take-over of characters in to the batch name to be built up. So you may hide a suffix.

    $

    Marks the end of the barcode. You should always close your regular expression with this character.

  7. For both Scan process steps, type regular expressions that reproduce the convention for the structure of the batch names described above:

    1. For the Scan process step in Level1, type ^4712001\d{5}$ under Pattern in the Batch name line.

    2. For the Scan process step in Level2, type ^4712002\d{5}$ under Pattern in the Batch name line.

  8. Save the processes.

6.6 Importing the batches again

  1. Restart the XBOUND Activities service so that the root documents from before are exported and deleted.

  2. Wait a few moments and then stop the service again.

  3. Enable the batch two batches for import again by using Windows Explorer to change the file extension of the two trigger files (20140313000071.imp and 20140313000070.imp) to rdy.

    If XBOUND is configured as described, this is what happens:

    1. The collector first extracts the root document name from a batch that is to be imported.

    2. The collector checks all scan process steps, checking whether the name matches one of the specified patterns.

      • If exactly one matching scan process step is found, then the batch will be imported.

      • If no matching scan process step is found, or if several are found, then the batch receives an error status (file extension err), and a log message is written to the Windows Event Viewer (as you have already seen).

  4. Return to the Process Monitor, click Refresh (), and note how the root document appears in the Level2 process. It bears the name 471200200001, which is the value of the batch barcode. The root document in Level1 process received the name 471200100001.


Chapter 7: Controlling process flows

When specifying process flows, you can create branches in your process. You can run the documents in parallel through these branches, or you can run the documents through only one branch. If the document is to be processed in only one of the branches, then you must defined process rules with conditions that decide which of the branches a document is to be processed in.

7.1 Branching the process

Let us create a process with two branches:

  1. Stop the XBOUND Activities service, if it is running (to prevent imported batches from being processed further and immediately deleted).

  2. Using the Process Designer, create a new process called Level3 in the Tutorial client.

  3. Create a process step for the Scan documents activity within this process, and name it Scan.

  4. Double-click the process step to open it.

  5. Now we need to specify a regular expression that matches all of the batch names that we want to import. Without going into detail about regular expressions, let us click in the Pattern column of the Batch name row and type ^4712003\d{5}$.

  6. Click OK.

  7. Create two export process steps using Adapter for File System (Structured).

    • Name them Export1 and Export2.

    • Specify a different export path for each one.

  8. Draw arrows from Scan to each of the new process steps:

  9. Right-click Scan and select Input/Output Rules. The Input and Output Rules dialog is displayed.

  10. Select Allow parallel tasks and click OK.

  11. Activate the process.

  12. Save the process.

7.2 Checking the result

  1. Using Windows Explorer, change the file extension of the trigger file 20140313000072.trigger to rdy.  

  2. Watch as the batch is imported by the XBOUND Collect Service and the file extension changes to imp.

  3. Return to the Process Monitor, refresh, and select the Level3 process. You will see that one document is waiting each of the Export document process steps Export1 and Export2. But you imported only one document, didn’t you?

    The Level3 process specifies that imported documents are to be processed in both of the subsequent process steps. So you see the same document waiting in both process steps. How is this possible?

    In fact the document is not located in a particular process step, but just a task for the document. In the upper pane of the Process View you actually see the number of tasks waiting in the process steps. The document exists independently from tasks. In fact, documents can exist in XBOUND without any task.

  4. To demonstrate this, start the XBOUND Activities service. After a short time the tasks disappear and you can see (using Windows Explorer) that the root document was exported to both of the directories that you configured. In the Process Monitor, you can see this message in the status bar of the process overview: "1 document."

    The tasks are deleted because processing—as we have defined it so far—ends with the two Export process steps. However, the root document still exists as a document in XBOUND, since we have not yet defined a process step that deletes it.

  5. Click Check for unassigned documents in the Process Monitor to display the root document.

  6. Select the document and click Delete document () to remove it from XBOUND.

Note: You would have the same result (export to two different directories) if you used Closedtwo Export process steps in a row. We introduced this (quasi) parallel processing to show the simplest possible example. However, in the real world parallel processing of documents in different branches can be quite useful.

7.3 Synchronizing tasks

  1. In the Level3 process, create a Delete Documents process step. Name it Delete.

  2. Draw arrows from Export1 and Export2 to Delete.

  3. Save the process.

    If you imported batch 20140313000072 again, you would face a problem: Both tasks would run, and the document would be processed twice in the Delete step. The first time, the Delete Documents application would refuse to delete the document, since multiple tasks exist for the document. Only when the second task arrives is deletion successful (since only one task exists). This is successful, but not very elegant; consider the unnecessary error messages and system load.

    Instead, in the Delete process step let's make XBOUND reduce both incoming tasks to one before the document is processed. You could also say that the incoming tasks are synchronized.

    To synchronize tasks in a process step, XBOUND has to know how many tasks are to arrive at this process step. (As we will see in the next section, this does not always correspond to the number of arrows ending at this process step.)

    Since the process can be quite complex, it is generally not possible for XBOUND to determine the number of all tasks to be synchronized from the process structure. You must specify this number yourself. In our example the number is 2.

    Now synchronize the Delete process step for two incoming tasks:

  4. Right-click the Delete process step and select Input/Output Rules.

  5. In Number of parallel tasks to synchronize, type 2.

  6. Select Allow multiple tasks.

  7. Click OK.

  8. Save the process.

7.4 Checking the result

To illustrate, let us disable (or pause) two process steps so that we can see documents step through the system.

  1. In the Process Monitor, select the Export1 process step.

  2. Click Pause Process Step:

  3. Do the same with the Delete process step.

    The disabled process steps have a red "pause" symbol on them.

  4. Release the batch named 20140313000072 for Level3 for import again by using Windows Explorer to change the file extension of the trigger file 20140313000072.imp to rdy.

  5. Return to the Process Monitor. After a few moments (and after clicking Refresh), you will see a pending (Ready status) task in the Export1 step, and the Delete step has a task with the status Synchronize. The latter originated in Export2, which was not disabled.

    After scanning (import), XBOUND created two tasks, one for each of the Export steps. One was executed and proceeded to Delete. There it got Synchronize status, because the second process step must be executed before proceeding to the third one – and that is on hold in the disabled Export1 step.

  6. Restart Export1 by selecting it and clicking Start Process Step:

  7. Click Refresh () again. Soon you see that a task is pending in Delete. The task in Export1 was executed by XBOUND and routed to Delete. There it was synchronized with the other task and merged in one task – which is now pending.

  8. Restart the Delete process step in order to finish processing this root document.

7.5 Controlling document flow

With branched processes, the goal is normally not parallel processing but to route the document through one branch or the other. Which path the document takes is determined by the document properties. This is called routing.

In the last section we drew arrows between the process steps. These arrows are called process rules because they determine how documents are routed. But so far we have not included any conditions. This is why XBOUND created a task for each arrow and, as you saw in the previous section, it duplicated the task when two arrows originated from the same process step.

Next we will specify a condition for one of these process rules. Conditions are based on document properties, so we must first specify what those properties are.

7.6 Creating document types and field definitions

Often the content of one or more document fields forms the basis of how a document is routed. Before you formulate a process rule that defines how this is to be done, you must first specify which fields you expect in that document. You do this by creating field definitions.

Field definitions always apply to a particular document type. Document types indicate the functional category of a document, and they are associated with a specific process.

Use this procedure to create the document type Batch in the Level3 process:

  1. In the Process Designer, select the Level3 process.

  2. In the Process area, click Document Types:

  3. Click +. The Document Type dialog is displayed.

  4. In Document type name, type Batch as the name for the new document type.

  5. Click OK.

  6. Save the process.

Now XBOUND knows that documents with the document type Batch are to be expected in our Level3 process.

Create a field definition called Name for this document type. Use this procedure:

  1. Select the Batch document type.

  2. Near the bottom of the window, click the open lock symbol ( ).

  3. In the Name column, type Name as the name of the new field definition.

  4. Click the closed lock symbol ().

  5. Save the process.

Now XBOUND knows the Batch document type and that a Name field is expected in documents of this type.

7.7 Assigning a document type to imported documents

So far you have imported batches without assigning a document type to the resulting documents. Let us configure the Scan process step so that the root document that it creates contains the Batch document type.

Use this procedure:

  1. In the Process area, click Process Design:

  2. Double-click the Scan process step in the Level3 process. The settings for the Scan Documents activity are displayed.

  3. In the Root document type box, select Batch as the document type that is to be assigned to the imported batch.

  4. Click OK.

  5. Save the process.

7.8 Specifying a condition in a process rule

Now we can write a condition that routes the incoming documents: If the Name field has a certain value, then the root document is processed in the first branch of the process. Otherwise, it is processed in the second branch.

Write a condition for the process rule from Scan to Export1, specifying that the Name field is to have the value 471200300001. Use this procedure:

  1. Double-click the process rule (the arrow) between Scan and Export1.

  2. Click New expression.

  3. Select Field value in Operand.

  4. In Document type name, select Batch.

  5. In Field name, select Name.

  6. Click OK.

  7. In the Value field, type the value to be checked for (in this case 471200300001).

  8. Click OK.

  9. Save the process.

After entering the condition, you see in the Process Designer that the process rule is not blue anymore, but green, and it has a flag symbol. This shows that the rule has a condition.

7.9 Checking the result

  1. For illustration, return to the Process Monitor and pause Export1 and Export2.

  2. Release batch 20140313000072 for import for Level3 again by changing the file extension of the trigger file 20140313000072.imp to rdy.

  3. Back in the Process Monitor, click Refresh (). You will see that one document is pending in Export1 in the Level3 process. XBOUND checked the condition that you added to one of the two process rules leading from the Scan process step. Because the condition was met, XBOUND generated a task for that branch.

    No task was forwarded by XBOUND to the other branch, because a condition was met on the first process branch. (You can read about how XBOUND proceeds when multiple process rules originate from a single process step in Synchronizing several tasks.)

  4. Use Windows Explorer to change the file extension of the trigger file 20140313000073.trigger to rdy.

  5. Back in the Process Monitor, click Refresh (). After a moment you will see that a second batch (now a root document) is pending for processing in Export2 process step, which the blue arrow points to. Obviously the condition hidden behind the green arrow was not met. If you Closedlook at the first page, you will see why: The batch barcode has the value 47120030002.

    1. Click Export2.

    2. Click Media.

    3. Right-click the image and select Zoom > 50%.

  6. You no longer have a parallel process flow, but conditional branching. This means that tasks are not duplicated, but basically just forwarded. There can be only one task per document, so task synchronization is no longer needed in the Delete process step.

    Therefore, switch back to the Process Designer and reset the synchronization by setting the number of expected tasks in the Delete step to 1. (Right-click Delete and select Input/Output Rules.)

  7. Do not forget to save the process.

7.10 Delayed processing

You have seen how we can pause or disable process steps in order to keep root documents (or rather, their tasks) at a process step for illustration purposes. Occasionally it is necessary to delay document processing in production environments. For example, often you want to wait a certain period of time after documents are processed before deleting them.

For such purposes, you can configure a process rule to specify how much time must pass before the task can be executed. Use this procedure to configure a one-minute delay for each of the process rules that point to Delete:

  1. In the Process Designer, double-click one of the process rules (arrows between process steps) that points to the Delete process. The Edit Process Rule dialog is displayed.

  2. Click Extended rule settings.

  3. Under Time delay, select how long to delay processing the task (one minute).

    (Tip for future reference: Often it is necessary to apply a process rule to not just root documents but to sub-documents, as well. For that you have the Rule applies to root and sub-documents settings, which are described in more detail in Applying process rules to sub-documents.)

  4. Click OK.

  5. The process rule arrow now contains a clock symbol (). One minute must pass before the task can execute the next process step.

  6. Repeat the above steps on the other process rule that points to the Delete step.

  7. Save the process.

  8. Return to the Process Monitor and restart the Export1 and Export 2 process steps.

After a short time (click Refresh), you will see both tasks pending at the Delete process step, with Waiting status.

The change of status is carried out in the background by a system agent, namely the Agent for Document Resubmit. At a specified time interval it looks for pending tasks and sets them to the Incoming status if their waiting time has passed. This means that the time configured in the process step is a minimum time. Depending on the time interval specified for the agent, and how the two times coincide, more time can pass than what the process step was configured for.

7.11 Changing the polling cycle of a system agent

The interval at which the agent checks waiting tasks can be configured. In a production environment, an interval of 1800 seconds (a half hour) is a reasonable value. To try it out, set it to 30 seconds:

  1. Click the Add/remove Plug-Ins button () and add the System Agent Manager to the console.

    If the plug-in is not available, you must first add it to the XBOUND Management Center (file name xboundPlugInSystemAgents.dll).

  2. Click System Agent Manager in the Consoles pane.

  3. Drag XBOUND Agent for Document Resubmit from the System Agents pane (at the bottom) to a service in the Computers and Services pane.

  4. Optional: Type a new name and click OK.

  5. In the Subscriptions pane, click in the Parameter set column for the new entry.

  6. Type the interval in seconds (30).

  7. Click OK.

  8. Select Enabled for the new entry.

  9. ClosedRestart the XBOUND System Agent Service to which you assigned the agent.

    1. Select Start menu > Control Panel > (View By Icons) > Administrative Tools > Services.

    2. In the Services dialog, right-click XBOUND System Agent Service and select Restart.

  10. In the Process Monitor you can see that both Waiting tasks are soon executed, and the documents are deleted from the XBOUND system.


Chapter 8: Using barcodes to determine document structure

Documents are used in XBOUND to represent business transactions for which physical records (usually in paper form) exist. Papers can be scanned and imported to XBOUND as electronic documents.

Business transactions often have a hierarchical structure. For example, an invoice can consist of the actual invoice plus attachments. The attachments are usually only archived, while data like invoice number, data and amount are typically extracted from the actual invoice pages.

Furthermore, "invoices" can be divided into two types: Invoices and credit notes.

Invoices and credit notes are grouped in root documents in order to simplify the processing of large volumes of documents.

So we have the following document model:

During import, a root document is created that contains media created from scanned pages. The above structure exists implicitly, but it is not yet shown in XBOUND.

For further processing it is very useful to show the document structure in XBOUND. We do this by dividing the root document into sub-documents, which themselves can contain sub-documents.

A simple yet robust structuring procedure uses identification sheets (separator sheets) with barcodes to indicate where a document begins and ends The separators are inserted manually into the stack of papers before scanning.

In this chapter we will do the following:

This is the structure of the two batches before and after processing:

Before import

 

After processing (8-5)

 

Before import

 

After processing (8-7)

We will proceed one step at a time so that you can see how this is achieved.

8.1 Setting up the process

First complete these preparation steps:

  1. Using the Process Designer, select Edit > Copy Processes and create a copy of the Level2 process in the same client.

  2. Change the name of the copy from Level21 to Level4.

  3. Create document types called Batch, Invoice, Credit note, Voucher, and Attachment in this process. (Click Document Types and then +.)

  4. Configure Scan by specifying the regular expression ^4712004\d{5}$ as criterion of the name and by selecting Batch as the Root document type.

  5. Delete the arrow between Scan and Export by clicking it and then pressing Delete on your keyboard.

  6. Create a Classify by Barcodes process step and name it Interpret barcode.

  7. Draw an arrow from Scan to Interpret barcode.

  8. Create a Build Document Structure process step and name it Structure.

  9. Draw an arrow from Interpret barcode to Structure.

  10. Draw an arrow from Structure to Export.

  11. Configure a separate export directory in Export.

  12. Save the process.

  13. Assign Classify by Barcodes and Build Document Structure to the XBOUND Activities service. (See Assigning activities and applications to the XBOUND Activities service above.)

8.2 Configuring barcode interpretation

Let us configure the Interpret barcode process step so that the barcodes on the separator sheets can be recognized and the corresponding document types assigned.

  1. Using the Process Designer, double-click the Interpret barcode step. The corresponding settings are displayed.

  2. Select Invoice as the document type.

  3. Type the regular expression ^555100$ in the Barcode box.

  4. Select Start under Start/End. This means that when a barcode with the value 555100 is found, the page that follows will be an invoice.

  5. Click +.

  6. In the second row of the table, select Credit note as the document type.

  7. Type the regular expression ^555300$ in the Barcode box.

  8. Select Start under Start/End. This means that when a barcode with the value 555300 is found, the page that follows will be a credit note.

  9. Click OK to close the configuration dialog.

  10. Activate and save the process.

  11. Switch to the Process Monitor, click Refresh, select the Level4 process, and pause the Structure step (since it is not yet configured).

  12. Using Windows Explorer, change the file extension of the trigger file 20140313000074.trigger to rdy.

  13. Wait a few moments until the rdy changes to imp. (Alternatively, restart the XBOUND Activities service so that it notices the change immediately.)

8.3 Checking the result

  1. Return to the Process Monitor and click Refresh. Notice that the 47120040001 document has moved to the Structure step.

  2. Click Structure. The root document is displayed in the lower pane. Click it there.

  3. Click Media and use the arrow buttons to browse the 14 sheets that are included in the root document.

    You can see that each separator sheet (except the first one, which was meant to identify the batch) has a Document type listed. Those sheets are now classified.

    So what we have is a root document with two invoices and a credit note, each of which begins with a corresponding separator sheet. There are no attachments.

8.4 Using the interpreted barcodes to create sub-documents

Now we can use the classified separator sheets to divide the root document into sub-documents. This is achieved by the default settings in the Structure step. (The settings are described here.)

8.5 Ignoring blank pages

You have seen in the Process Monitor that our sample batches have both front and back pages. However, the back pages are blank. Let us prevent those back pages from all further processing.

  1. Using the Process Designer, double-click the Export process step. Notice that Export empty pages is not selected. However, the process does not yet contain a step that detects that pages are blank. Let us remedy that.

  2. Create a Detect Empty Pages process step and name it Detect blanks.

  3. Double-click Detect blanks and select Process back pages and Set delete flag. This means that front pages will be ignored in this step, and blank back pages will be excluded from further processing.

  4. Delete the arrow between Structure and Export.

  5. Draw new arrows from Structure to Detect blanks and from Detect blanks to Export.

  6. Save the process.

  7. Assign Detect Empty Pages to the XBOUND Activities service.

8.6 Checking the result

  1. Click Refresh in the Process Monitor.

  2. Pause the Delete step and restart the Structure step.

  3. Restart the XBOUND Activities service (or wait a few moments).

  4. When the document is processed in Structure, Detect blanks, and Export, it ends up pending in the Delete process step.

    Click the Delete step to display the root document.

    Notice that three sub-documents of the corresponding type were created in the root document. Each contains its separator and an invoice or credit note (each with front and back pages). ClosedA simplified view of what happened to the structure:

    Before

     

    After

    As you can see, the back pages are still present in the XBOUND system. However, they were not exported because those pages are being ignored due to the Set delete flag setting in Detect blanks. To verify this, use Windows Explorer to navigate to the export directory that you specified. There are only two images in each subdirectory, rather than four.

8.7 Separating vouchers from their attachments

We have not yet worked with attachments. (The sample batch 47120040001 did not contain any.) In this section we will make use of two other document types which we already set up: Voucher and Attachment. We will use these to separate vouchers (meaning actual invoice or credit note pages) from their attachments.

  1. In the Process Designer, rename Interpret barcode to Interpret barcode 1 and Structure to Structure 1.

    Insert two more process steps between Structure 1 and Detect blanks:

  2. Double-click Interpret barcode 2 and configure it as follows:

    1. Assign the barcode patterns ^555100$ and ^555300$ (two table entries) to the Voucher document type.

    2. Assign the barcode pattern ^555200$ to the Attachment document type.

  3. Double-click Structure 2 and deselectKeep separator for class start.

  4. Save the process.

  5. Using Windows Explorer, change the file extension of the trigger file 20140313000075.trigger to rdy. (This batch contains attachments.)

  6. Restart the XBOUND Activities service (or wait a few moments).

8.8 Checking the result

  1. Click Refresh in the Process Monitor.

    After the root document named 471200400002 was processed in Structure 2, it was immediately exported and is now pending in the Delete process step (which we disabled).

  2. In the top part of the screen, click the Delete step to display the root document.

    Notice that we now have two sub-document levels:

    • The first separates each invoice or credit note from the next.

    • The second separates each voucher (invoice or credit note) from its optional attachments.

    The separators with the barcodes were deleted. ClosedA simplified view of what happened to the structure:

    Before

     

    After


Chapter 9: Processing documents and media that meet specified criteria

With XBOUND you can configure process steps in such a way that only documents or media that meet specified criteria are processed – for example:

This filtering prevents documents and media that do not meet the specified criteria from being processed in the process step. (More information.)

9.1 Creating a filter

In this section we will filter documents by their properties in order to export invoices and credit notes without their attachments:

  1. In the Process Designer, right-click Export in the Level4 process and select Filter Settings. The Filter Documents and Media dialog is displayed.

  2. Under Condition, select Filter documents by document type.

  3. Click Filter documents by document type and select the Voucher document type.

  4. Click Add.

  5. Click OK.

  6. Save the process.

9.2 Checking the result

  1. Using Process Monitor, delete the root document named 471200400002.

  2. Reimport it: Using Windows Explorer, change the file extension of the trigger file 20140313000075.imp to rdy.

  3. Restart the XBOUND Activities service (or wait a few moments).

As soon the root document is exported, you can see in the export directory in Windows Explorer that only the vouchers were exported, and no attachments or separators.

You can also see that the export structure duplicates the document structure in XBOUND:


Chapter 10: Splitting documents by document type

Now we want invoices and credit notes to be exported to separate directories. We could try to achieve this using filter settings as described above. However, invoice and credit note documents are intermediate levels in our example, and the documents themselves are always of the type Voucher or Attachment. Therefore, if we try to filter for invoices, the vouchers and attachments are suppressed. If we accept vouchers and attachments, too, then we get all vouchers and attachments – including those of the credit notes.

One solution would be to define new document types for the credit notes and attachments, and filter those documents out. However, let us instead use the Split Documents activity to create root documents that contain either only credit notes or only invoices in their first sub-level.

10.1 Splitting up the documents

  1. In the Level4 process, insert a Split Documents process step before the Export step. Adjust the arrows accordingly.

  2. Double-click the new process step.

  3. Under Split mode, select Extract.

  4. Select Split by document types.

  5. Select Credit note click Add.

  6. Click OK.

  7. Save the process.

10.2 Checking the result

  1. Using Process Monitor, delete the root document named 471200400002.

  2. Reimport it: Using Windows Explorer, change the file extension of the trigger file 20140313000075.imp to rdy.

  3. Restart the XBOUND Activities service (or wait a few moments).

  4. Switch to Process Monitor, where you can see that the one root document has split into two. One root document contains the invoices, and the other contains the credit note.

10.3 Exporting to different directories based on document type

Now we have two root documents that contain either only invoices or only credit notes. We will export them into separate directories using two export process steps:

  1. Rename the Export process step to Export invoices.

  2. Double-click the process step and configure a new export directory for the invoices.

  3. Insert an additional Adapter for File System (Structured) process step called Export credit notes between Split documents and Delete, parallel to the Export invoices process step, like this:

  4. Double-click Export credit notes and configure an export directory for the credit notes.

  5. Right-click Export credit notes and select Filter Settings. The Filter Documents and Media dialog is displayed.

  6. Configure the filter so that it only applies to the Voucher type. It will look like this:

  7. Double-click the arrow between Split documents and Export credit notes and configure a process rule to permit only documents that contain at least one Credit note:

  8. Save the process.

10.4 Checking the result

When you import the batch again, invoices and credit notes will be exported to separate directories.

  1. Switch to Process Monitor and click Refresh so that you can see the updated process.

  2. Delete the root documents named 471200400002 and 2.

  3. Reimport: Using Windows Explorer, change the file extension of the trigger file 20140313000075.imp to rdy.

  4. Restart the XBOUND Activities service (or wait a few moments).

  5. Return to the Process Monitor to ensure that the imported documents have reached the Delete step.

  6. Return to Windows Explorer, where you can see that invoices and credit notes were exported into separate directories as configured.


Chapter 11: Cleanup: Deactivate or delete the Tutorial

To ensure that the objects and processes that you created here do not interfere with other work being done in XBOUND:

  1. Using the Process Monitor, delete all remaining tutorial documents from XBOUND.

  2. Using the Process Designer, deactivate and save all of the processes. Alternatively, delete the processes or the entire client.


Chapter 12: For a deeper understanding

Gaining a deeper understanding of the following areas will make it easier to create and configure your own processes and get them into production.

12.1 Managing collectors

The XBOUND Collect Service runs different tasks that must be carried out independent of processing documents in the process steps.

You can add new collectors using the Process Designer. You can install and run the Collect Service on several computers. You can also limit the data that a collector processes.

Read more about collectors in XBOUND collectors: Overview.

12.2 Managing activities

When a new document (for example a batch of scanned attachments) is imported into XBOUND, there is typically a task available to process this document in a particular process step. You can see this in the Process Monitor. Each process step represents a very specific processing task.

In the tutorial you used the Process Designer to create process steps by selecting activities and dragging them into your processes.

In addition to the activities that are already available in XBOUND, it is possible to add your own.

12.3 Managing agents

There are tasks in XBOUND which cannot be done by activities or collectors. Examples:

These tasks are done by so-called system agents (or just agents).

Read more about agents in XBOUND system agents: Overview

12.4 Managing rights and privileges

Within XBOUND you can control which actions certain users or groups can perform by assigning them rights or privileges.

In XBOUND, a number of privileges are predefined, and you can assign these privileges immediately using the Security Manager. The Security Wizard can also be used.

Read more in Security in XBOUND: Overview.