Batch processing
Connect can not only be used to create single documents, but also handles batch processing, i.e. a larger set of individual documents can be created via a single Connect call and optionally merged into a single document after creation.
When batches are processed, there are certain specifics in the process that should be noted:
For a batch, there is only one ConnectorResult for the entire batch. If a single document ends with "Error", the entire batch is considered to be faulty. The same is true for "Cancel". If an "Error" and a "Cancel" occurs in a batch, the result will be "Error".
The CreateConnectorResult command and filter commands are only considered on the batch level.
The TemplatePicker must not be used, accordingly for each document to be created in the batch the template must be clear at the beginning. The reason for this is that the TemplatePicker is executed asynchronously to the entire batch and thus it is not guaranteed to pass when the overall result is evaluated. If this is not guaranteed for an entry in the batch, the Document Creation Server will return a
400-Bad-Request
error message. On the client side, this can be handled, but must be avoided for reasons previously stated.If Batch Level Commands are specified, the first command must be a Merge command. On the server side, the Merge command must always be specified, even if no other batch-level commands are specified, since the server can only ever return one response, i.e. one document. In the event that several individual documents are to be generated and processed via the Document Creation Server, it is recommended that this is done via individual calls.
Advantages:
Requests can be executed in parallel, thus reducing the time required per document (see Performance).
Further time saving by omission of the Merge command
Each document can be processed individually and the result is known for each individual document.
Disadvantage: More network traffic
If no Batch Level Commands are specified, several documents can be generated with the client at the same time. On the server side this is supported in that the SaveAs command can be specified on the Document Level Commands to save the documents individually. However, the result will still be the document merged with the Merge command.
The CreateConnectorResult command does not immediately create the result file. It only sets the flag that a file should be written. The result file is always written after all commands are completed. As soon as a "Cancel" or "Error" occurs, the remaining documents and commands are no longer considered for the
ConnectorResult
.
Â
NOTE
To ensure that all connect commands, i.e. on element as well as on batch level have been executed successfully, only the result file of the entire batch operation can be used.
NOTE
It is not possible to evaluate the result of both document generation and the commands themselves via Connect commands if the TemplatePicker is used. In this case, the result file must also be used at individual level.
PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland