Each case type configuration defines a mapping between SmartDocuments template and document type. This mapping is used to get the correct template and template group with the Document creation flow below.
The ZAC - SmartDocuments document creation flow is as follows:
- User starts SmartDocument wizard from ZAC ('create document'). This can be done either from a case (zaak) or from a task.
- ZAC sends an HTTPS request to start a document creation wizard to SmartDocuments and sends case- and other information in this request.
- The document creation wizard is started in SmartDocuments. Case or task information and template type are pre-filled.
- At the end of the document creation wizard, SmartDocuments:
- creates a Word document and stores it on SmartDocuments side for later retrieval
- calls a ZAC callback endpoint with information about the created document
- ZAC callback endpoint in turn:
- Downloads the Word document from SmartDocuments
- Creates a document ('enkelvoudiginformatieobject') in the ZRC API implementation (also known as 'zaakregister'; in the context of ZAC this is usually OpenZaak).
- Confidentiality of the document is set to PUBLIC and the document status to IN_PROGRESS
- Usage permissions ('Gebruiksrechten') are set for the document. Without this step the zaak to which this document belongs cannot be closed nor interrupted.
- The document/enkelvoudiginformatieobject is linked to the case or task in question (by creating a ‘zaakinformatieobject’).
- The zaakregister sends a notification to Open Notificaties that a new document has been linked to a case or task.
- Open Notificaties sends a callback request to ZAC informing ZAC of this event.
- Depending on which SmartDocuments environment is used and how it is configured, the user also has the option to download the document to their local computer.
- When the user returns to the ZAC browser tab, they will see the new document attached to the case or task.
This flow is visualised in the following sequence diagram:
sequenceDiagram
actor Employee
participant SmartDocuments
box ZAC landscape
participant ZAC
participant OpenZaak
participant OpenNotificaties
end
Employee->>+ZAC: Create document for a case or task
ZAC->>SmartDocuments: Create document with template related to the case type
deactivate ZAC
Employee->>SmartDocuments: Fill in remaining document data
Employee->>SmartDocuments: Click "Finish" in the creation wizard
SmartDocuments->>SmartDocuments: Create document
SmartDocuments--)+ZAC: Provide document information
ZAC->>SmartDocuments: Download document
ZAC->>+OpenZaak: Store document
ZAC->>OpenZaak: Link document to case or task
OpenZaak->>-OpenNotificaties: Send notification that a new document is linked to a case or task
OpenNotificaties--)ZAC: Received notification "document linked to a case"
ZAC->>-Behandelaar: Document is zichtbaar in de zaak
ZAC->>Employee: Redirect to result page
Employee->>Employee: Close document creation wizard tab