Audit including version of entity (withVersion filter parameter)

If you want get audit revision including version of entity. You must specify filtering options withVersion. withVersion is boolean flag in IdmAuditFilter. When this filtering options is set to true is returned IdmAuditEntityDto instead of IdmAuditDto.

The logic for check this attribute is done in service DefaultAuditService in toDto method.

Returned IdmAuditEntityDto extends from IdmAuditDto. IdmAuditEntityDto returns attribute entity this attribte contains whole version of entity. Entity is stored as map where string is key and value is object. As key is used attribute names.

For delete operation doesn't exists version value. So in entity attribute will be the last version of entity.

This whole mechanism use feature supportsToDtoWithFilter. The service DefaultAuditService has set this feature on, the method toDto(IdmAudit entity, IdmAuditDto dto, IdmAuditFilter filter) is called instead of toDto(IdmAudit entity, IdmAuditDto dto).

Feature withVersion is primary used on frontend agenda for identity role audit, password change audit and audit of login.

  • by kopro