Letter Composer
Let an employee choose a letter in a task, fill in what the case is missing, and generate it with one process step.
User guide navigation
On this page
Letter composer
Use the letter composer when an employee chooses which letter to send, at the moment the case needs it. One form component offers a list of letters. The employee picks one, fills in what the case cannot supply, and sees a live preview. One process step then generates the chosen letter.
Without the composer, ten letters would need ten previews and ten generate steps. With the composer, adding a letter is one row in its settings.
How it works
- The employee chooses a letter in the Epistola Letter Composer component on a task form.
- The plugin runs the mapping against the case. The composer asks only for the required fields the mapping did not fill.
- The employee fills them in and checks the preview.
- When the form is submitted, the chosen letter is stored in a process variable, for example
epistolaLetter. - A service task with the Generate Dynamic Document action generates that letter.
The letter keeps the data from the preview. So Epistola generates the letter with the data the employee previewed, even if the case changes in between.
Add a composer to a process
- Add a user task, for example Choose letter, with a form.
- Drop the Epistola Letter Composer component on that form.
- Under Name for the chosen letter, fill in a name, for example
epistolaLetter. - Choose the plugin configuration, the environment and the catalog. Then tick the letters to offer, and give each one the name the employee should see.
- Optionally, open Mapping and advanced settings. Fill in a baseline mapping over
$docand$pv, which applies to every letter. - After the user task, add a service task with the Generate Dynamic Document action.
- Under Document variable, fill in the same name, for example
epistolaLetter. The action needs no template or mapping of its own: the letter holds them. - Fill in a result process variable. Then wait for the document, as described in Wait for documents.
Environment and release
The composer chooses an environment and a release, in the same way as the Generate Document action. Both are JSONata expressions. If you leave the environment empty, the plugin uses the default environment of the configuration. If you leave the release empty, Epistola uses what the environment serves: the draft it follows, or else the highest release deployed there. Without an environment, Epistola uses the highest release (the highest version number).
The letter carries the Release setting, not the release it found at preview time. So if a new matching release is deployed between the preview and the generate step, Epistola uses that new release. This also happens when Release is empty. Only an exact version such as "1.4.0" prevents it.
Good to know
- The composer asks only for required fields, unless you turn on Also ask for optional fields the mapping left empty.
- Fields that the mapping already fills are not offered. Correct case data in a case form, not in one letter.
- A letter with many fields is split into steps. By default, this happens above six fields.
- A composed letter always uses the default variant of its template.
- With Also save these values on the case, the composer can save values from the letter on the case, such as what the employee typed. The generate step saves them when it generates the letter.
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 →