Distribute a document (synchronous or asynchronous)¶
Delivers an xPression document either immediately via a synchronous SOAP call, or deferred via an MSMQ queue for asynchronous processing.
| Field | Value |
|---|---|
| Operation ID | OP-PRINT-DISTRIBUTE |
| Trigger | Caller invokes the public distributeDocument(package, xml) overload, or sets properties directly and invokes the private distributeDocument() |
| Inputs | Package, XML (trimmed), Asynchronous flag, printer/plex/scale/copies, OutputProfile, ImportInfo, email/fax info, IDMPath, deferred-print info |
| Outputs | Boolean success flag (True after successful completion) |
| Primary components | clsPrint.distributeDocument, clsPrint.StartMQTransaction, clsPrint.EndMQTransaction |
| Entry point | SAIF.Services.Printing\clsPrint.vb |
Steps¶
- Caller sets
Package/XML(trimmed) via the public overload, or directly via properties, then invokes the privatedistributeDocument(). - If
Asynchronous = True: - Lazily opens/reuses an MSMQ
MessageQueueatm_MessagePath(thedocumentMSMQPathconfiguration setting). - Builds a
CompositeRequestClasssnapshot of all current property values (package, XML, printer, plex/scale mode, copies, format, output profile, import info, email info, fax info, IDM path, deferred info). - Serializes the request with
Messaging.BinaryMessageFormatterinto aMessage. - Ensures an MSMQ transaction is active — calls MSMQ transaction lifecycle:
StartMQTransaction()if one was not already started by the caller, sends the message, then commits the transaction (EndMQTransaction(True)) if it started the transaction itself.- On any exception: rolls back the transaction (
EndMQTransaction(False)) and re-throws.
- On any exception: rolls back the transaction (
- If
Asynchronous = False: callsm_Xpresso.distributeDocument(...)directly (synchronous SOAP call) with the same full parameter set, hard-codingPaperTray.Tray2as the tray selection.Origin: This step is implemented in
xpresso.clsGenerate(SAIF.Services.Printing.xpresso) and executed against the external xPression Design server.* - Returns
True(public overload) after the private method completes without throwing.
Process flow¶
flowchart TD
Start([Caller sets Package/XML]) --> Decision{Asynchronous?}
Decision -->|Yes| Queue[Build CompositeRequestClass]
Queue --> Serialize[Serialize with BinaryMessageFormatter]
Serialize --> Txn[Start/reuse MSMQ transaction]
Txn --> Send[Send message to MSMQ queue]
Send --> Commit[Commit transaction]
Commit --> EndOk([Return True])
Send -->|Exception| Rollback[Rollback transaction and re-throw]
Decision -->|No| Sync[Call m_Xpresso.distributeDocument]
Sync --> EndOk
Failure and edge-case behavior¶
- On any exception during the asynchronous path, the MSMQ transaction is rolled back (
EndMQTransaction(False)) and the exception is re-thrown to the caller. - The synchronous path hard-codes
PaperTray.Tray2; no caller-supplied tray override is honored for synchronous distribution.*
Related documentation¶
Sources¶
SAIF.Services.Printing\clsPrint.vbSAIF.Services.Printing\Web References\xpresso\Reference.vb