Skip to main content

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

FieldDescription
FromLeave it empty, specifying 'from' is not necessary
ToNot necessary
Function typeDefines the function type. Needs to be "Enrichment/lookup functions".
FunctionDefines the function. Needs to be Save audit record
messageAn 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 FieldSource in GatewayMessage / ContextDescription
aftermessage.asMap(true)Stores the full content of the message as a key-value map.
objectnameDerived from mapperName, plugin, and endpointComputed object name using available message context information.
endpointMessageContextManager.getEndpointName(message)The endpoint associated with the message (retrieved from the context).
pluginMessageContextManager.getPluginName(message)The plugin responsible for the message (retrieved from the context).
objecttypemessage.getRecordType()The type of record represented by the message.
timestampnew Date()The timestamp when the audit entry is created.
objectidmessage.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.
messageOptional StringThis is the optional text that the user specifies in the message field of the mapping