In the collect phase, StreamServer analyzes the incoming data, detects documents (Events), and creates the Messages. Sorting of incoming documents is also done during the collect phase.
When StreamServer analyses the incoming data, and detects a document, the job begins internally in StreamServer. StreamServer will now start to scan the input for fields and new documents. All fields found are stored in a Message associated with the current Event. If a field is configured to create a variable, this is done at this stage. If a new Event is found, it will be added to a list of found Events, and any fields found after this will be associated with the Message for the new Event. This procedure continues until a list of all Events, with all fields, in the input job is created. The Messages are stored in sequence in a temporary storage.
As the last step in the collect phase, the stored Messages can be sorted. Sorting is based on the values of the script variables. To add more logic to sorting, a Retrieved script can be executed after each Event has been collected. At this stage, the variables for the Event are already created, and can be updated in the script, which in turn affects the result of sorting.
The pre-process phase starts when the collect phase ends. During the pre-process phase, all Events and Processes in the input job are executed without producing any output data. For example, during the pre-process phase, the number of pages are calculated, page breaks are located, overlays are added, etc.
StreamServer reads Messages stored in the temporary storage one Message at a time. For each Message, the internal Message structure is recreated in memory, and then all Processes and scripts related to that Event are executed. Each Message, including the information gathered during the pre-process phase, is again written to the temporary storage.
The process phase starts when the pre-process phase ends. All information needed to create the desired output is available during this phase. The Processes and scripts are run as in the pre-process phase, but now the information retrieved during the pre-process phase is used to create the output.
Before the process phase starts, all variables are rolled back to the values they had before the pre-process step – this since all scripts in are run in the pre-process phase. The same applies to all external data sources the scripts have updated. For example, databases updated using ODBC script functions.
StreamServer reads Messages stored in the temporary storage one Message at a time. For each Message, the internal Message structure is recreated in memory, and then the Processes and scripts are executed. The output is sent from the Processes, and stored in the output queues.