Configuring a print queue

To use the message printing service, you must configure print queues. More than one print queue might be defined per OU. To define a print queue, you must configure a CO of type DnqPrintQueue and add it to the OU. The name of the CO corresponds to the name of the print queue.

To help you do this, FTM SWIFT generates, during customization, for each business OU, a script with a name of the form:
deployment_dir/instance/admin/ou_dnqcpcqo.cli
where:
deployment_dir
Directory specified in the CDP initialization file.
instance
Name of the instance.
ou
Name of the OU.
The script contains the following commands:
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr InputEnabled
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr PrintDeviceType -val <DeviceType>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr PrintDevice -val <Device>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr PrintOptions -val <Options>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr PrintLineLength -val <LineLength>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr PrintPageLength -val <PageLength>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr PrintFormatHeader -val <FormatHeader>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr PrintFormatMessage -val <FormatMessage>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr OrderSize -val <OrderSize>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr OrderTimeout -val <OrderTimeout>
;add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr Confirmation
;add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr BICExpansion
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr Priority -val <Priority>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr TargetQueue -val <TargetQueue>
add -ct DnqPrintQueue -ou DNIvOU -co <printQueueName> -attr TargetQMgr -val <TargetQueueManager>

add -ct DnqPrintOpAccessControl  -ou DNIvOU -co <printQueueName>  -attr status 
add -ct DnqPrintOpAccessControl  -ou DNIvOU -co <printQueueName>  -attr start
add -ct DnqPrintOpAccessControl  -ou DNIvOU -co <printQueueName>  -attr stop
add -ct DnqPrintOpAccessControl  -ou DNIvOU -co <printQueueName>  -attr reprint
add -ct DnqPrintOpAccessControl  -ou DNIvOU -co <printQueueName>  -attr confirm
add -ct DnqPrintOpAccessControl  -ou DNIvOU -co <printQueueName>  -attr release
add -ct DnqPrintOpAccessControl  -ou DNIvOU -co <printQueueName>  -attr delete

com -ou DNIvOU
The customization process substitutes the placeholder DNIvOU in the scripts with the name of the OU. Modify and run these scripts as follows:
  1. Copy the scripts into the home directory.
  2. Ensure that all commands that are to be executed are activated, that is, that they are not preceded by a semicolon character (;).
  3. Replace the following items in the copy of the scripts as required:
    <printQueueName>
    The name of the print queue. This name can be at most 30 characters long and can contain only:
    • Characters of the set [A-Za-z0-9]
    • Periods (.)
    • Hyphens (-)
    • Underscore characters (_)
    Note: If you use underscore characters in a print queue name, you must precede each of them with two backslash characters when administrating and operating this queue by using the CLI. For example, if you configure a print queue with the name My_Print_Queue, and if you want to start this queue later on, you must issue the following command to the print command service (DNQ_P_CMD):
    start -qname My\\_Print\\_Queue
    See Special characters for more information.
    InputEnabled
    This pseudo attribute indicates that the DnqPrintInputAdapter node of a message flow is to accept and import messages for this print queue and store them into the message database of the message printing service. If not configured, the DnqPrintInputAdapter node does not import messages for the queue.
    PrintDeviceType <DeviceType>
    Specifies the type of the printer device:
    0
    This value corresponds to the device type PrintToPrinter. Specify this if you want print output to be sent to a printer.
    1
    This value corresponds to the device type PrintToFile. Specify this if you want print output to be stored in files.
    PrintDevice <Device>
    The meaning of this attribute depends on the printer device type:
    • If PrintDeviceType=0 (PrintToPrinter), use this attribute to specify the command for the print queue to which the temporary files are to be sent for printing, for example:
      lpr -P MyPrinter
      The print process removes the temporary file immediately after it has invoked the specified print command. Consequently, you must specify a print command that internally creates a copy of the temporary file, for example:
      • If you specify the qprt command, you must specify the -c flag, which causes the qprt command to copy the temporary file and to print from this copy.
      • If you specify the lpr command, do not specify the -s flag. The -s flag causes the lpr command to print from the temporary file directly instead of copying it, and this requires that the temporary file is not removed until after it has been printed.
      You can refer to the temporarily file by placeholder $FILE. The print process replaces each occurrence of $FILE with the temporary file before invoking the command. For example, if you specify the command
      lpr -P MyPrinter $FILE && echo $FILE >> /tmp/mylist.txt
      then the following command is invoked for the temporary file /myworkingdirecoty/PrintQPrinter_100057.prt:
      lpr -P MyPrinter /myworkingdirecoty/PrintQPrinter_100057.prt && echo 
      /myworkingdirecoty/PrintQPrinter_100057.prt >> /tmp/mylist.txt
      If you do not use the $FILE placeholder, the print process automatically appends the temporary file as the last argument to the command. For example, if you specify
      lpr -P MyPrinter 
      as the print command, the print process invokes the following command:
      lpr -P MyPrinter /myworkingdirectory/PrintQPrinter_100057.prt
      If you specify the name of a shell script instead of a command, the broker must be able to run this script, that is:
      • The broker must have access to the directory that contains the script.
      • The broker must have execute permission for the shell script.
      For example, if you specify /home/smith/print.sh, the broker must have:
      • Access to the directory /home/smith
      • Execute permission for the shell script print.sh
    • If PrintDeviceType=1 (PrintToFile), this attribute specifies the directory in which the print output files are to be stored. This output directory must satisfy the following conditions:
      • It must be different from the working directory, which is specified by the WorkingDirectory attribute of the CO DnqPrintService of type DnqPrintService.
      • The broker must have read and write access to it.
      If the print output must be kept secure, specify an output directory to which access is restricted. Access to the directory /tmp is usually not restricted.
    PrintOptions <Options>
    The meaning of this attribute depends on the printer device type:
    • If PrintDeviceType=0 (PrintToPrinter), this attribute is ignored.
    • If PrintDeviceType=1 (PrintToFile), this attribute specifies the prefix to be added to the name of each print output file.
    When printing an order to a file, the name of the output file is generated automatically by the message printing service, and has the form:
    <prefix><ou>_<printQueueName>_<ordersn>_<timestamp>.prt
    where:
    <prefix>
    The value assigned to the PrintOptions attribute. Note that, if you want an underscore to appear before the name of the OU, you must specify it explicitly as part of this value.
    <ou>
    The name of the OU for which the print output file is to be generated.
    <printQueueName>
    The name of the print queue to which the order belongs.
    <ordersn>
    The sequence number of the order.
    <timestamp>
    Date and time, in Coordinated Universal Time (UTC), when the message printing service generated the output file. The format is YYYYMMDDHHMMSS.
    For example, if the PrintOptions attribute is set to Main_, and the message printing service generates the output file for BANKA, print queue PrintQFile, and order sequence number 100291 on 31 August 2013 at 14:05:32 (2:05:32 P.M.) UTC, then the generated output file has the following name:
    Main_BANKA_PrintQFile_100291_20130831140532.prt
    PrintLineLength <LineLength>
    The number of characters the printer is able to print per line. This must be a number from 1 to 999. The default is 80.
    PrintPageLength <PageLength>
    The number of lines that the printer is able to print per page. This must be a number from 1 to 999. The default is 60.
    PrintFormatHeader <FormatHeader>
    A message printout can include either or both of the following types of information from the MQRFH2 header of the message:
    History information
    This is the contents of the ComIbmDni.History folder in the MQRFH2 header of the message.
    Other information
    This is the contents of other fields and folders of the MQRFH2
    This attribute specifies which information is to be included in the printout:
    0
    Do not include history information or other information.
    1
    Include history information but not other information.
    2
    Include other information but not history information.
    3
    Include both history information and other information. This is the default.
    PrintFormatMessage <FormatMessage>
    This attribute specifies how the content of a message should be formatted in the printout:
    0
    Formatted output. Print all fields of each message.
    1
    Formatted output. Print only those fields that contain values. This is the default.
    2
    Line format output.
    OrderSize <OrderSize>
    This attribute specifies the number of messages that are to constitute a single print job. When the order size is reached, the order is processed and a corresponding print job is submitted. The order size must be a whole number that is greater than 0. Because the processing of a large order can significantly and adversely affect the availability of system resources, setting an order size larger than 1000 is not recommended. The default is 1.
    OrderTimeout <OrderTimeout>
    This attribute specifies the number of minutes after which an order is processed regardless of whether its order size was reached. The default is 0, which deactivates the timeout and causes the print order to be printed only when its order size was reached.
    Confirmation <Confirmation>
    This pseudo attribute indicates whether manual confirmation is required. If this attribute is specified, each order must be confirmed manually as correct and complete after it was printed. Messages are considered to be in process until the confirmation was done.
    BICExpansion <BICExpansion>
    This pseudo attribute indicates whether the following information, which is contained in the FTM SWIFT reference data database, is added to the printout for each message:
    • Institution name of each BIC
    • Location of each BIC
    • Branch information about each BIC
    Priority <Priority>
    Priority of the print queue. This must be a number from 0 to 9, with 9 representing the highest priority. The default priority is 5.
    TargetQueue <TargetQueue>
    This attribute specifies the queue into which the message printing service is to place messages after it finished processing them. If this attribute is not configured, the messages are not exported after printing.
    TargetQMgr <TargetQueueManager>
    This attribute specifies the queue manager of the target queue. The default is the queue manager used by the message printing service.
  4. Run the modified copy of the ou_dnqcpcqo.cli script. This requires the access rights provided by the system configuration administrator (DniSA) role:
    dnicli -i instance -ou SYSOU -s DNI_SYSADM -cf ou_dnqcpcqo.cli
  5. Approve and deploy the changes:
    dnicli -i instance -ou SYSOU -s DNI_SYSADM
    app -ou ou
    dep -ou ou
If dual authorization is enabled, another user with the appropriate access rights must approve the changes before they can be deployed. If dual authorization is disabled, you can skip approving the changes and immediately deploy them.
Note: If you change the configuration of a print queue, you must stop and restart the queue to activate the change.