User Tools

Site Tools


pub:smartrouting6

[ Return to Table of Contents]

Smart Routing

Overview

Smart Routing (not to be confused with the optional iDocs SmartRouter module) is a set of features in iDocs that permits the automatic routing of merged documents to Email, Fax and/or Print. It is implemented in two basic ways:

  1. The routing information can be retrieved from a database using spool file information as the database key, or
  2. The routing information can be scraped directly from the spool file.

Smart Routing Using a Database

The first step is to create a mapped field that contains the database key value. This for example might be a customer number if you are using a customer database file. From the main InFORM Decisions menu, take option one, Define a form or Check Application. Locate the form application and place a two next to the application. Next locate a sample spool file and select this spool file with an option one and press enter twice.

At this point, the left column of the screen should display the corresponding lines numbers of the spool file. Additionally the key value, such as the customer number, should be in full view. If the value is not in full view, the display screen may be shifted right by using the shift F8 key.

With the key value in full view, position the cursor in the leftmost position of the value and press the F8 key. Next, place the cursor in the rightmost position of the key value and press the F8 key again. This will display the Map Field Maintenance screen.

Complete the field prompt by entering a field name and description. Enter 9998 for both horizontal and vertical positions so the data does not print on the output page – those coordinates are off the pcl page.

Secondly, specify a sort sequence. You should specify a sort sequence if you wish to group pages to one target into one transmission. For example, if you are emailing based on customer number you probably want to group all pages to a particular customer into one attachment and send the customer one email. Odd sort sequences sort in ascending order, even sequences sort in descending order.

Bursting should be set to Y. This will create a new document and thus a separate transmission, email fax or print, to the target. If you do not burst then each input spool file will generate one output transmission to the target found on the first page only of the document.

The normal procedure is to sort and burst on this field.

Database Definition for Smart Routing

Smart Routing considers output targets to Email, Fax and/or Print. Any output method not defined will be skipped.

In the prompt for the Distribution Out Queue enter the key word value of either *EMAILPDF to process the distribution of the spool files in a PDF format, *EMAILPCL to process the distribution of the spool files in a PCL format.

In order to target destination can be resolved, Destination Out Queue must be defined as *EMAILPDF or *EMAILPCL if you want to route for Email, Fax and Print. Destination Out Queue *FAX to route for Fax and Printing and *PRINT to route for Print only

From the 'Work with Form Applications' screen, place an option 14 next to the entry and press Enter to open the 'Smart Routing Configuration' screen

In the main screen of Smart Routing, you can specify the target destination for Email in Email Settings, for Fax in Fax Settings and for Print in Print Settings

Smart Routing can support up to three key fields for an external database. You can indicate the key values in fields 1st Key, 2nd Key and 3rd Key, or press F4 to select a spool map field from a list of available fields defined on the form application.

Email, Fax and Printing external database name can be the same or different, it means you can specify the different (or same) databases for Email, Fax and Printing.

In this screen specify the file name and library of the database file containing the Smart Routing address information. It can be a either a Physical or a Logical file. In the field specifying the Map field data to use as key, enter the name of the mapped field defined to contain the database key. This field must be defined as a keyed field on the PF or LF.

The new Smart Routing supports two approaches to access the databases: + The old approach: retrieve target destination by database column position by input a position at Extract Field From and To (like as old Smart Routing) + The new approach: retrieve target destination by database field name.

Besides database retrieval, the user is also able to use constant value for target destination by enter value in ‘Constant Value’ screen fields. Be aware of the data is only retrieved from database field, column position or constant value.

The further settings can be defined in F6=Email Settings (for Email), F7=Fax Settings (for Fax) and F8=Print Settings (for Print)

Invalid Out Queue : if target destination is unresolved, the output is removed or moved to Invalid Out Queue (if specified)

An enhancement for IFDClient was added in 6.95 (7/24/20). If the IFDClient DataQ is specified, when smart routing is processed, it will create a temporary PDF into /tmp/idocs – this PDF is independent with any PDF created for SR mail, then a message is sent to data queue. If IFDClient is running, it will be able to download this PDF into PC user.

By default, Data is *SPJUSR which is the user ID of original spool file. Thus, if IFDClient is monitoring the data queue with key is user ID, the PDF will be sent to respective user ID.

Email Settings

You can set the condition for email to allow or forbid an email. If the condition does not match, the email will not be sent. If this option is enabled, the email is processed only if the result of condition returns true. DB Field or Extract Field From/To: enter database field name or a column position. If the fields is input, the database record will be checked the condition. Operator : the valid values are = (equal), <> (not equal), < (less than), ⇐ (less than or equal), > (greater than), >= (greater than or equal) Spool Map Fld or Constant Enter value for only one of them.

  • If the Spool Map Fld is input, the value of database field will be compared with the value of spool mapped field.
  • If Constant is input, the value of database field will be compared with the constant.

Some other settings are: From Address, CC Address, BCC Address, Email Subject, Mail Message… have similar usage as To Address in main screen, it means only database field, column position or constant value is input.

* CC Address: indicate the CC address; the usage is same as ‘TO Address’. The intention of adding the constant value is in case the user wants to have a copy to someone; they will not need to change their existing database.

* BCC Address: indicate the BCC address, the usage is same as TO Address

* Subject: indicate the subject of email. The user can input a constant value and/or retrieve information from the database or from the spool file attributes (6.99 4/12/22).

* Request Delivery Receipt and Request Read Receipt should be ‘Y’ or ‘N’

* Message: indicate the email message. The user can input a constant value and/or retrieve information from the database or from the spool file attributes (6.99 4/12/22).

Using individual mapped fields to create the Subject Line:

On the Subject's Constant Value field, you can use a text for the constant plus the name of the Mapped Field preceded by & to insert the value from the Mapped Field.

Example: Select the form application with option 8=Work with map fields and review the defined mapped fields:

  8/09/21                     iDocs Form Suite                        FM2540C1  
 19:00:28              Spooled Datamap Field Maintenance              KKRAMER   
                       Form: ANGUYENSR1 Spoolfile EMAIL_TEXT                    
                                                                                
  1=Select   3=Copy   4=Delete   5=Display                                      
                                                                                
                                      From     To     Map                       
 Sel Fld Name   Description          Row Col Row Col  Type   Fld   Xloc    Yloc 
     BLOCK001   Invoice Number        10  14  10  23   2            678     618 
     BLOCK002   Bill to               13   2  18  23   2            678     921 
     BLOCK003   Customer Info         10  72  10  93   2            678     718 
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                         Bottom 
                                                                                
 F3=Exit   F6=Add   F7=Font/No Font   F12=Cancel                                
                                                                                
                                                   
Spool File data:
sr_dynamic_spool-file.jpg

Work with Form Application and select option 14=Smart Routing. The following Smart Routing Configuration screen is displayed:

  8/09/21                      iDocs Form Suite                       FM1205R1  
 18:39:47               Smart Routing Configuration                   KKRAMER   
                                                                                
 Application: ANGUYENSR1 Description: Spoolfile EMAIL_TEXT                      
 1st Key: INVOICDEID  -  2nd Key:             -  3rd Key:                       
 IFDClient DataQ :             Library :             Data :                     
 Email Settings                                                                 
  File SRTEST1      Library . ANGUYEN       Member  *FIRST                      
  TO Address  . . . . . . . . @EMAILTO      Extract Field From         To       
   OR Constant Value  . . . .                                                   
  Invalid Mail Out Queue  . . TUANANH       Library QGPL                        
 Fax Settings                                                                   
  File SRTEST1      Library . ANGUYEN       Member  *FIRST                      
  To Fax Number . . . . . . . @FAXTONO      Extract Field From         To       
   OR Constant Value  . . . .                                                   
  Invalid Fax Out Queue . . . TUANANH       Library QGPL                        
 Print Settings                                                                 
  File              Library . *LIBL         Member  *FIRST                      
  Printer Queue  *LIBL      /               Extract Field From         To       
   OR Constant Value:   Queue               Library *LIBL                       
  Invalid Printing Queue  . . FORM001       Library IDOCS6                      
 F3=Exit  F4=Prompt    F6=Email Settings   F7=Fax Settings  F9=Delete SR        
 F8=Print Settings  F10=Update   F12=Previous        F13=Attachment Output      
                                                   

Now select F6=Email Settings. The following Smart Routing Configuration - Email screen is displayed:

  8/09/21                      iDocs Form Suite                       FM1205C2  
 19:08:18          Smart Routing Configuration - Email                KKRAMER   
                                                                                
 Application: ANGUYENSR1 Description: Spoolfile EMAIL_TEXT                      
 File: SRTEST1     Library . ANGUYEN       Member  *FIRST                       
 Conditional Setting:  DB Field             Extract Field From         To       
   Operator  Spool Map Fld  OR  Constant (*BLANK, *ZERO, Value)                 
                                                                                
                                                                                
  From Address. . . . . . . .               Extract Field From        To        
   OR Constant Value  . . . .                                                   
  CC Address  . . . . . . . .               Extract Field From        To        
   OR Constant Value  . . . .                                                   
  BCC Address . . . . . . . .               Extract Field From        To        
   OR Constant Value  . . . .                                                   
  Subject . . . . . . . . . .               Extract Field From        To
   OR Constant Value  . . . . Invoice &BLOCK001 &BLOCK003                         
  Request Delivery Receipt  . N (Y/N)       Request Read Receipt N (Y/N)        
  Message . . . . . . . . . .               Extract Field From         To       
   OR Constant Value  . . . .                                                   
   This is test message of smart routing dynamic SUBJECT from mapped fields     
                                                                              + 
 F3=Exit   F4=Prompt   F10=Update   F12=Previous                                
Note that Invoice is the constant value text
&BLOCK001 will insert the value collected from Mapped Field BLOCK001 (Row 10 Col.14-23)
&BLOCK003 will insert the value collected from Mapped Field BLOCK003 (Row 10 Col. 72-93)

Output example of Subject line:

Using individual spool file attribute values to create the Subject Line and Message Body:

In the Subject's or Message body constant value field, you can use any text for the constant plus the name of the listed Spool File attributes to insert the value from the attribute. (6.99 4/12/22)

&USRPRF   = Job's User Profile
&SPLNAM   = Spool File's Name
&SPJNAM   = Job's Name
&SPJUSR   = Spool File's User Profile
&SPJNUM   = Job's Number
&USRDTA   = Spool File's User Data
&FORMTYPE = Spool File's Form Type
&TIME  = Job's processed time
&DATE  = Job's processed date
&TOTALPGS = Spool File's Page total

Fax Settings

Fax Settings is also defined as Email Settings

Print Settings is also defined as Email Settings

Smart Routing Examples

Example 1

Description: We’ll use the EXAMPLE01 Form Application with the Invoice spool file which is a one page invoice.

When the Form Application is merged with the spool file sequences 1, 2, and 3 will be outputted to a Destination Out Queue with a writer for printing. In our example the Out Queue is called GOODOUTPUT.

Sequence 4 has a Destination Out Queue *EMAILPDF which is a reserved destination. *EMAILPDF will trigger iDocs to use Smart Routing. In our example we are using the iMail Address Book (option 3. Work with Users from the iMail menu) to acquire the email destination address; and we are using option 14.Smart Routing on the Form Application to configure the settings to trigger the look up of the email address by using the User Profile of the spool file owner.

In our example when Smart Routing is triggered the configuration will use the User Profile (*SPJUSR) of the job's spool file as the Key to search the EFLDIST2 (physical file that holds address book information) file in the IDOCS695 and use the email address in field DIEMAILADR corresponding to the User Profile. If no email address is available or a bad email address, then the PCL output will be sent to the Invalid Mail Out Queue BADOUTPUT.

In the Email Address Book we tie in the User Profile with the email address information by filling in the User Profile parameter in the address book record as shown in the example.

Example 2

Description: In this example we set all the sequence’s Destination Out Queue to be *EMAILPDF. This will send all three outputs as one PDF to the recipient.

pub/smartrouting6.txt · Last modified: 2022/06/25 17:02 by 127.0.0.1