Save Audit Record Mapping
SaveAuditRecordMapping
The SaveAuditRecordMapping is a mapping used for saving audit records in the system. It operates by creating an audit entry based on the last message in the MappingContext and then records it regardless of the storage method specified in the application.properties file (e.g., MongoDB, message, etc.).
SaveAuditRecordMapping configuration
| Field | Description |
|---|---|
| From | Leave it empty, specifying 'from' is not necessary |
| To | Not necessary |
| Function type | Defines the function type. Needs to be "Enrichment/lookup functions". |
| Function | Defines the function. Needs to be Save audit record |
| message | An optional message. If provided, the message parameter will be stored in the message field of the audit record |
Audit Record Fields Mapping
The following table details how fields from the GatewayMessage are mapped to the AuditEntry:
| AuditEntry Field | Source in GatewayMessage / Context | Description |
|---|---|---|
after | message.asMap(true) | Stores the full content of the message as a key-value map. |
objectname | Derived from mapperName, plugin, and endpoint | Computed object name using available message context information. |
endpoint | MessageContextManager.getEndpointName(message) | The endpoint associated with the message (retrieved from the context). |
plugin | MessageContextManager.getPluginName(message) | The plugin responsible for the message (retrieved from the context). |
objecttype | message.getRecordType() | The type of record represented by the message. |
timestamp | new Date() | The timestamp when the audit entry is created. |
objectid | message.getId() | The unique identifier of the message. |
action | "record" | Specifies the action performed. |
type | "record" | Specifies the type of the audit entry. |
user | "n/a" | The user performing the action (defaulted to "n/a"). |
status | "Ok" | The status of the audit entry. |
message | Optional String | This is the optional text that the user specifies in the message field of the mapping |