CodamAIDocs
Topicdone

Preview, final, transient

The three modes PREVIEW, FINAL and TRANSIENT: what is stored and sealed, how each format says what it is (watermark and marker), and when TRANSIENT is allowed.

Variants
PREVIEWFINALTRANSIENTFINAL switched off → document-revisions-disabledTRANSIENT switched off → transient-documents-disabledTRANSIENT from a tenant or user template → transient-requires-system-templateTRANSIENT as CSV → render-mode-not-for-format

What this is about

Every render request names a mode. It decides whether CRMS keeps the document and how the document itself says what it is. There are three modes:

  • PREVIEW: for checking while editing. Visibly carries “PREVIEW”, is never stored.
  • FINAL: a record. It is sealed, stored as the next revision and only then returned.
  • TRANSIENT: a working copy that someone downloads, prints or hands on. No watermark, not stored, but marked as transient in its metadata.

The three modes compared

What each mode does
PREVIEWFINALTRANSIENT
Storednoyes, as the next revision of the document chainno
Sealednoyes (PDF, if a seal is set up)no
Visible watermarkyes, PREVIEWnono
Marker in the metadatacrms-previewnonecrms-transient
Reference needednoyesno
Attachments allowedyesnoyes
Header Crms-Document-Revisionnoyesno
Switched onalwaysif final documents are storedonly if switched on, only for system templates

How each format shows the mode

FormatPREVIEWTRANSIENTFINAL
HTML<meta name="crms-preview" content="true"/> and a large, slanted PREVIEW across the page<meta name="crms-transient" content="true"/>nothing
PDFPREVIEW as a light grey watermark, keyword crms-preview in document information and XMPkeyword crms-transient in document information and XMPnothing
DOCXfirst paragraph PREVIEW, keyword crms-preview in the document propertieskeyword crms-transient in the document propertiesnothing
XLSXPREVIEW in the print header and as title, keyword crms-previewkeyword crms-transientnothing
ODSkeyword crms-preview in the metadatakeyword crms-transient in the metadatanothing
CSVfirst line PREVIEWrefused: render-mode-not-for-format|csvnothing

XMP is metadata inside a PDF that archive systems read. CSV has no metadata. It cannot say that it is transient, so CRMS refuses TRANSIENT for CSV.

The flows

One mode, one flow

When: someone checks a template or a draft of the report

  1. 1
    Client→CRMS
    sends mode: PREVIEW
  2. 2
    CRMS
    checks request and payload, renders
  3. 3
    CRMS
    sets watermark and marker crms-preview
  4. 4
    CRMS→Client
    returns the bytes
    Result: preview, stored nowhere

When: the document is a record, for example a completed inspection report

  1. 1
    Client→CRMS
    sends mode: FINAL with reference
  2. 2
    CRMS
    checks request and payload, renders
  3. 3
    CRMS
    seals the PDF, if a seal is set up
  4. 4
    CRMS→File storage
    stores the document as the next revision of the chain, in the caller's transaction
  5. 5
    CRMS→Client
    returns the same bytes, with Crms-Document-Revision
    Result: record stored, revision known

When: a working copy to download, print or hand on, from a system template

  1. 1
    Client→CRMS
    sends mode: TRANSIENT
  2. 2
    CRMS
    Is TRANSIENT switched on in this installation?
  3. 3
    CRMS
    Does the revision found come from the SYSTEM scope?
  4. 4
    CRMS
    renders and sets the marker crms-transient, without a watermark
  5. 5
    CRMS→Client
    returns the bytes
    Result: copy without watermark, stored nowhere

What is stored for FINAL and what the chain looks like is described in What a final document is. The seal is explained in The seal.

When a mode is refused

ModeConditionResult
PREVIEW–allowed
FINALwithout referencerequired on field reference (REST)
FINALthe installation stores no final documents409 document-revisions-disabled
FINALwith attachments422 attachments-not-for-final
TRANSIENTnot switched on409 transient-documents-disabled
TRANSIENTrevision from scope TENANT or USER422 transient-requires-system-template
TRANSIENTformat CSV422 render-mode-not-for-format|csv
TRANSIENTswitched on and system templateallowed

You switch TRANSIENT on with CODAMAI_CRMS_TRANSIENT_DOCUMENTS=true. The default is false. Whether final documents are stored is set on the CRMS module in the hub, see The CRMS module in the hub.

Why only system templates? A system template has passed the platform’s approval. A tenant must not be able to use the mode to produce documents without a watermark from its own template that the platform never saw. Where system templates can come from is described in Templates from the build.

Pitfalls

Next

Search