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: