When InterFormNG2 is printing via a physical printer, then the usual procedure is, that InterFormNG2 generates a print data stream, which is sent to the printer and if the complete print data stream was sent to the printer, then the assumption is, that the print out has successfully been printed.
To get a better status InterFormNG2 can also get a confirmed status from the printer and react to the status as shown below.
Success or error print detection
InterFormNG2 can call a workflow when a print is completed, either in a success or an error.
The detection of a success or an error is from the last point, where InterFormNG2 could follow the print.
Depending on technology, this can be from just delivering the print successfully or until the print is actually reported out on paper.
This it is not a guarantee that the print was actually printed, since printers, print servers etc. might ignore reporting back. The most reliable technology (connection method) is
IPP and even here nothing is guaranteed.
This can be done my setting one or two workflow variables:
1. interform.destination.workflow.success
This will call the workflow with the endpoint set in the variable, when a print is succesful.
2. interform.destination.workflow.error
This will call the workflow with the endpoint set in the variable, when a print failed.
The workflow variable interform.finished.status will tell any additional messages from the printer or the system (if available).
The different types of communication protocols will handle the success/failure in the following way:
System printer
Reports success when the OS printer queue reports "No more events" or "Print job completed)
Reports failed when the OS printer queue reports "Job failed", "Job cancelled" or there was an error delivering the print to the os.
Unfortunately Windows is known for just saying "No more events" when the print is put on the queue.
Direct socket
Reports success when the socket accepted the entire print and closed the network connection.
Reports failed otherwise.
LPD Protocol
Reports success when the print server accepted the entire print and closed the network connection.
Reports failed otherwise.
IPP Protocol
Reports success when the print server accepted the print and the IPP tracking got a job-completed-successfully from the printer.
Reports success if the printer accepted the printer and the status couldn't be reported back within 3 hours.
Reports failed otherwise.
SMB Protocol
Reports success if the shared printer accepted the print.
Reports failed otherwise
Spool print
Reports to success if written to the spool
Reports to failed otherwise
Example: Add records in a database to indicate the final print status
In the example below three workflows are used in order to print two documents and to report the print status of each document in a database. The workflows are:
Print_Main: This workflow first references the two other workflows and then print a documents. One of the other workflows will be called depending on the print status.
Print_error: This workflow is called (with the limitations mentioned above) if a print out fails.
Print_Success: The workflow is called if the print was successfully printed (with the limitations mentioned above).
The
Print_Main workflow looks like below: (The
input type is not included as it is not important)
The first component looks like this:
It sets these 3 variables:
PrintKey We intend to use this variable to uniquely identify the print request. This is not really needed, but it can be useful. Normally this could e.g. be the document number of the document, that is printed.
interform.destination.workflow.success The value of this variable must be the name of the workflow to call (if any should be called) if the printing is successful.
interform.destination.workflow.error The value of this
variable must be the name of the workflow to call (if any should be
called) if the printing fails.
Next the Print_Main workflow does the printing with this component:
- and then the main workflow is done.
The Print_error workflow can be used for implementing a workaround if a print fails or it can e.g. report or register the issue. In this case it adds a record in a database. The Print_error workflow looks like below:
The
input type is
From other workflow, where the workflow name is defined:
The component in this workflow is this:
This component adds a record in the table, KSE/PRINT_STS with two fields: PRINTID and STATUS. The PRINTID is the identification of the document, which here is the variable, PrintKey. That variable was previously defined in the main workflow, Print_Main and the value is kept when this workflow is called.
The STATUS of the printing is stored as the value of the variable, interform.finished.status. This is a status text, that is returned from the printer.
For the Print_Success workflow the setup is here the same as the Print_error workflow: