Store Content in IDOL Server > Process Data before you Index > Route Documents to Different Tasks > Set up a Route Task

Set up a Route Task
Use the following procedure to set up a Route task.
To set up a Route task
1.
Open the IDOL server configuration file in a text editor.
2.
[MyRouteTask]
3.
Set Module to Route, to identify the task as an ACI task.
Module=Route
4.
Specify the condition that determines which tasks comes next. Set Condition to exists, if you want IDOL server to check that a particular field exists in the new document. If you set Condition to equals, IDOL server checks that a particular field contains a specific value. For example:
Condition=exists
5.
Parameter1=OCR
6.
Parameter2=OCRData
7.
Specify the task to perform if the document meets the condition. This must match the name of the configuration file section that contains the settings for the task that you want IDOL server to perform next on a document that meets the specified condition. For example:
OnTrueTask=MyOCRTask
8.
Specify the task to perform if the document does not meet the condition. This must match the name of the configuration file section that contains the settings for the task that you want IDOL server to perform next on a document that does not meet the specified condition. For example:
OnFalseTask=MyCatTask
9.
Specify any other parameters that you want to apply to your Route task. For details on available parameters, refer to the IDOL server Online Help. For example:
OnFailureTask=MyFileWriterTask
10.
Save the IDOL server configuration file and restart IDOL server for your configuration changes to take effect.
Related Topics 
*
Examples
In the following example, a Route task checks for documents containing OCR data. It then sends documents that contain OCR data to an OCR task, while it sends other documents to a Cat task. This task is described in Figure 1.
Figure 1 A simple route task
This example uses the following configuration:
[IndexTasks]
StartTask=MyRouteTask
[MyRouteTask]
Module=Route
Condition=Exists
Parameter1=OCR
OnTrueTask=MyOCRTask
OnFalseTask=MyCatTask
[MyOCRTask]
Module=OCR
GoodTask=MyIndexTask
BadTask=MyFileWriterTask
[MyFileWriterTask]
Module=FileWriter
BatchSize=10
OutputDirectory=C:\Autonomy\IDXFiles
[MyCatTask]
Module=Cat
TextFields=DRECONTENT
TagField=CategoryTag
NextTask=MyIndexTask
Host=127.0.0.1
Port=9000
[MyIndexTask]
Module=Index
The StartTask parameter is set to the name of the configuration section where the Route Task is defined.
Every time IDOL server performs this task on an incoming document, it checks whether the document contains an OCR field. If it does, IDOL server forwards the document to MyOCRTask for processing. Otherwise IDOL server forwards the documents to MyCatTask.
MyOCRTask evaluates the quality of the files that contain an OCR field. It forwards files whose quality is satisfactory to MyIndexTask. It forwards files whose quality is unsatisfactory to MyFileWriterTask, which writes the files to disk.
MyCatTask matches documents that it receives from MyRouteTask against categories that the IDOL server category index contains and returns matching categories. It then tags the incoming documents according to which categories they match, and forwards them to MyIndexTask.
MyIndexTask indexes the files that it receives into the IDOL server data index.
Related Topics 
*
*
In the following example, a Route task checks for documents containing OCR data. Those that contain OCR data are then sent to an OCR Task, while other documents are sent to a second Route task, which checks for files marked to be sent to an SQL database. This task is described in Figure 2.
Figure 2 A complex Route task
This example uses the following configuration:
[IndexTasks]
StartTask=MyFirstRouteTask
[MyFirstRouteTask]
Module=Route
Condition=Exists
Parameter1=OCR
OnTrueTask=MyOCRTask
OnFalseTask=MySecondRouteTask
[MyOCRTask]
Module=OCR
GoodTask=MyIndexTask
BadTask=MyFileWriterTask
[MyFileWriterTask]
Module=FileWriter
BatchSize=10
OutputDirectory=C:\Autonomy\IDXFiles
[MySecondRouteTask]
Module=Route
Condition=Exists
Parameter1=SQL
OnTrueTask=MyHTTPTask
OnFalseTask=MyCatTask
[MyHTTPTask]
Module=HTTP
URL=http://sqlengine/insert
Fields=DRETITLE,DRECONTENT
RemapToFields=Title,Content
[MyCatTask]
Module=Cat
TextFields=DRECONTENT
TagField=CategoryTag
NextTask=MyIndexTask
Host=127.0.0.1
Port=9000
[MyIndexTask]
Module=Index
The StartTask parameter sets the name of the configuration section that defines the first Route Task.
Every time IDOL server performs this task on an incoming document, MyFirstRouteTask checks whether incoming documents contains an OCR field. If they do, the task forwards the documents to MyOCRTask. Otherwise it forwards them to MySecondRouteTask.
MyOCRTask evaluates the quality of the files that contain an OCR field. It forwards files whose quality is satisfactory to MyIndexTask. It forwards files whose quality is unsatisfactory to MyFileWriterTask, which writes the files to disk.
MySecondRouteTask checks whether documents that it receives contains a field marking it for sending to an SQL database. If it does, the task forwards the documents to MyHTTPTask. Otherwise it forwards them to MyCatTask.
MyHTTPTask maps the incoming documents’ DRETITLE and DRECONTENT fields to equivalent fields in an SQL database, and sends a HTTP call to the SQL database using a Web interface to insert the data into the SQL database.
MyCatTask matches documents that it receives from MySecondRouteTask against categories that the IDOL server category index contains, and returns matching categories. It then tags the incoming documents according to which categories they match, and forwards them to MyIndexTask.
MyIndexTask indexes the files it receives into the IDOL server data index.