Process History in BPMN
Every step of every process is recorded automatically in the process history - you do not model anything for it. Two things are in your hands: custom entries for business events and the level of detail per process or node.
Custom entries from a script task
Write a business event with one line in a script task:
ecceene.Bpm.history(kcontext, "RULE", "5k to 25k detected");
// with one value
ecceene.Bpm.history(kcontext, "LIMIT", "Approval limit exceeded", kcontext.getVariable("totalAmount"));
// with several values
ecceene.Bpm.history(kcontext, "CREDIT_CHECK", "Credit check done",
java.util.Map.of("score", 712, "provider", "Creditreform"));
| always |
| your category in capitals, e.g. |
| short readable text - it is shown in the history timeline |
| optional value or map; shown with |
In the BPMN XML:
<bpmn2:scriptTask id="_CheckAmount" name="Check amount" scriptFormat="http://www.java.com/java">
<bpmn2:script>ecceene.Bpm.history(kcontext, "RULE", "5k to 25k detected");</bpmn2:script>
</bpmn2:scriptTask>The entry appears in the history of the case (EccProcessHistory widget, GET /api/v1/process/{id}/history) with type, message and time - and with include=data also with its data and the process data (see Reading the Process History).
User tasks in the timeline
Every user task appears in the history automatically. Three task parameters of the BPMN model decide how it reads in the timeline:
| title of the entry - use a short subject, e.g. |
| grey subtitle - the group the task is assigned to |
| expandable details - longer text for the reader of the history |
Without Comment the task name is shown. Business data is not shown in the timeline.
Level of detail
| event plus a snapshot of all process variables |
| event without variables |
| nothing |
Set it as metadata attribute eccatm.history - on the process to change the default of the whole process, or on a single node:
<bpmn2:scriptTask id="_Poll" name="Poll supplier status">
<bpmn2:extensionElements>
<drools:metaData name="eccatm.history">
<drools:metaValue><![CDATA[off]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
</bpmn2:scriptTask>Typical uses: off for technical polling loops, minimal for steps with very large variables. Keep approvals and user tasks at full - that is the audit trail.
Entries are written in the same transaction as the step. If a step fails and is rolled back, its history entries are rolled back too - the history never shows steps that did not happen.
On this page
- Process History in BPMN