/ Search

Search Epistola

Find documentation, integration guides, tour steps, blog posts and pages.

DocsIntegrationsTourBlogPage
↑↓↵esc

Preview & Correct

Let users preview a document before it is generated, and correct the case when generation fails.

Preview and correct

Use a preview when users need to check a document before it is generated. When generation fails, let users correct the case and generate again.

Add a preview

The Epistola Document Preview component shows a live render of the document, built from the case and from what the user types in the form. It uses the same mapping as the generate step. The preview is a real render, but it is not stored and creates no generation job.

  1. Add the Epistola Document Preview component to the form.
  2. Under Where is this form shown?, choose In a user task or On a start form.
  3. Under Process Link, choose the Generate Document step whose document the preview should show.
  4. Keep Use the form’s field keys as overrides on. The preview then reads fields with a key such as pv:motivation or doc:/applicant/name from the form, before the user saves.
  5. Add Input Overrides only for fields whose key does not say where the value is stored, such as a step in a form flow.
  6. Choose whether the preview refreshes on its own while the user fills in the form. Users can also turn this on or off themselves.
  7. Test with realistic cases.

Correct the case and generate again

When a document fails, the cause is almost always in the case: a value is missing or has the wrong form. So the user fixes the case, and the process generates the document again.

  1. Route the failure path to a user task, for example Correct case data.
  2. Copy the reason to a variable the form can show, for example with an execution listener on the failure flow: ${execution.setVariable('generationError', epistolaResult.errorMessage)}.
  3. Build a normal case form. Show the reason read-only, and add the case fields the document uses, with their case path as key.
  4. After the task, loop back to the same Generate Document step. It runs its mapping again, on the corrected case.
  5. If it fails again, route the case to a person for review.

This way the case and the document cannot disagree. Later documents get the correction too.

The retry form is gone

Plugin 1.0 removed the retry form (epistola-retry-form). It changed the document instead of the case, so the next document failed in the same way. A form that still has that component shows nothing in its place. Replace it with a correction form as described above.

Good practice

Preview helps users make a decision. Do not turn it into a full document editor inside Valtimo.

More on this topic

Epistola is open source, not free of cost. The organisations that use it fund its development, through Epistola or an Official Partner. We are steward-owned: fair prices, no profit maximisation. How Epistola is funded →