Processing


Connect file processing follows a specific flow that can handle user interaction and error handling at certain points.

1. Call

Here it is distinguished whether the call is made with complete connect (Normal or Type Data), or via unstructured XML. In the second case, the correct XML transformer is searched for and applied to the XML. If this operation fails, the processing is aborted immediately. No ConnectorResult is created, but the server-side call returns an HTTP error code 500 (Server Error). This is because the processing has not even been started at this point, only the formatting.

2. Preparation

In this second step, the connect is read in and the sequence is established. If the read-in fails, this is processed regularly via the OnError commands. By default, the Connect XML is not subjected to a schema check, unless this was requested via the attribute Validate="true".

3. Template selection

There are three different ways to select the template:

  • The templateId is explicitly specified → selection unique, no user interaction needed

  • The template is filtered by tags. Then there are two possible consequences: a) Only one template matches the filter criteria → selection unique, no user interaction needed. b) More than one template matches the filter criteria → template picker is displayed to the user. This works only on a client call, not on the server. If the template picker is displayed, the user also has the option to cancel the action, which in turn ends in an OnCancel event.

4. Generation

The document creation itself is considered as a black box. In it, the various document functions attached to the selected template are applied and, if necessary, enriched with the data from the Connect call.

5. Execution of the document commands

After the actual document creation, commands (e.g. conversion to a PDF document) can be applied to the individual result. At the same time, the error and abort commands are executed at the document level.

6. Execution of the batch commands

After all individual document creations have been completed, commands can be applied to the entire batch again – e.g. the Merge command. At this point, error and abort commands are also executed from the cumulative results of the document commands. At the very end, if so requested by the Connect call, the ConnectorResult file is created. In case of a web call to the server, the created document is now returned as a stream.


ConnectResult

The ConnectResult can take the following values:

  • Success No errors occurred.

  • Cancel The user has canceled the process (or the previous one).

  • Error At least one error has occurred.

  • Unknown The status at this time is unknown. This occurs when the template picker was started (which is executed asynchronously).

Order/Prioritization: Unknown, Error, Cancel, Success If a process relevant to the result returns Unknown, then the result is also Unknown, regardless of whether another process was aborted or failed. The same applies to Error and Cancel. Success is only returned if everything was successful.

Example: Document generation: Success and: Commands Error gives an overall result of Error, even though the document generation itself was successful.

The ConnectResult has the following format:

<?xml version="1.0" encoding="utf-16"?> <OneOffixxConnectResult xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <InputFile> <!-- Path to the input file --> </InputFile> <Result> <!-- Success, Error, Cancel or Unknown --> </Result> <Message> <!-- Error message in case of error or the same as in the result (for compatibility reasons) --> </Message> <!-- In the messages tag, errors as well as warnings and information are output in detail. --> <Messages> <!-- There is one LogMessage per message. Attributes: Type: Error, Warning, Information Context: Describes the internal context, e.g. a document function, in which the error occurred. InternalMessage: Internal error message or error code TimeOfOccurence: Time of the error --> <LogMessage Type="Error" Context="N/A" InternalMessage="Unexpected Error" TimeOfOccurence="2019-10-04T17:18:47.9109335+02:00"> <Message> <!-- Readable error message --> </Message> <Exception> <!-- Technical error message --> </Exception> </LogMessage> </Messages> <!-- In the asynchronous case (TemplatePicker), 0-based index of the batch entry --> <EntryIndex>0</EntryIndex> </OneOffixxConnectResult>

 

PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland