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
| PREVIEW | FINAL | TRANSIENT | |
|---|---|---|---|
| Stored | no | yes, as the next revision of the document chain | no |
| Sealed | no | yes (PDF, if a seal is set up) | no |
| Visible watermark | yes, PREVIEW | no | no |
| Marker in the metadata | crms-preview | none | crms-transient |
| Reference needed | no | yes | no |
| Attachments allowed | yes | no | yes |
| Header Crms-Document-Revision | no | yes | no |
| Switched on | always | if final documents are stored | only if switched on, only for system templates |
How each format shows the mode
| Format | PREVIEW | TRANSIENT | FINAL |
|---|---|---|---|
| HTML | <meta name="crms-preview" content="true"/> and a large, slanted PREVIEW across the page | <meta name="crms-transient" content="true"/> | nothing |
PREVIEW as a light grey watermark, keyword crms-preview in document information and XMP | keyword crms-transient in document information and XMP | nothing | |
| DOCX | first paragraph PREVIEW, keyword crms-preview in the document properties | keyword crms-transient in the document properties | nothing |
| XLSX | PREVIEW in the print header and as title, keyword crms-preview | keyword crms-transient | nothing |
| ODS | keyword crms-preview in the metadata | keyword crms-transient in the metadata | nothing |
| CSV | first line PREVIEW | refused: render-mode-not-for-format|csv | nothing |
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
When: someone checks a template or a draft of the report
-
1Client→CRMSsends
mode: PREVIEW -
2CRMSchecks request and payload, renders
-
3CRMSsets watermark and marker
crms-preview -
4CRMS→Clientreturns the bytesResult: preview, stored nowhere
When: the document is a record, for example a completed inspection report
-
1Client→CRMSsends
mode: FINALwithreference -
2CRMSchecks request and payload, renders
-
3CRMSseals the PDF, if a seal is set up
-
4CRMS→File storagestores the document as the next revision of the chain, in the caller's transaction
-
5CRMS→Clientreturns the same bytes, with
Crms-Document-RevisionResult: record stored, revision known
When: a working copy to download, print or hand on, from a system template
-
1Client→CRMSsends
mode: TRANSIENT -
2CRMSIs TRANSIENT switched on in this installation?
-
3CRMSDoes the revision found come from the SYSTEM scope?
-
4CRMSrenders and sets the marker
crms-transient, without a watermark -
5CRMS→Clientreturns the bytesResult: 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
| Mode | Condition | Result |
|---|---|---|
| PREVIEW | – | allowed |
| FINAL | without reference | required on field reference (REST) |
| FINAL | the installation stores no final documents | 409 document-revisions-disabled |
| FINAL | with attachments | 422 attachments-not-for-final |
| TRANSIENT | not switched on | 409 transient-documents-disabled |
| TRANSIENT | revision from scope TENANT or USER | 422 transient-requires-system-template |
| TRANSIENT | format CSV | 422 render-mode-not-for-format|csv |
| TRANSIENT | switched on and system template | allowed |
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.