Skip to content

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

  1. Caller sets Package/XML (trimmed) via the public overload, or directly via properties, then invokes the private distributeDocument().
  2. If Asynchronous = True:
  3. Lazily opens/reuses an MSMQ MessageQueue at m_MessagePath (the documentMSMQPath configuration setting).
  4. Builds a CompositeRequestClass snapshot 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).
  5. Serializes the request with Messaging.BinaryMessageFormatter into a Message.
  6. 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.
  7. If Asynchronous = False: calls m_Xpresso.distributeDocument(...) directly (synchronous SOAP call) with the same full parameter set, hard-coding PaperTray.Tray2 as the tray selection.

    Origin: This step is implemented in xpresso.clsGenerate (SAIF.Services.Printing.xpresso) and executed against the external xPression Design server.*

  8. 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.*

Sources

  • SAIF.Services.Printing\clsPrint.vb
  • SAIF.Services.Printing\Web References\xpresso\Reference.vb