use of org.hisp.dhis.artemis.audit.AuditManager in project dhis2-core by dhis2.
the class AbstractEventAuditPostProcessor method process.
@Override
public void process(final Event event, final WorkContext ctx) {
final AuditManager auditManager = ctx.getServiceDelegator().getAuditManager();
final EventImporterUserService eventImporterUserService = ctx.getServiceDelegator().getEventImporterUserService();
final ProgramStageInstanceMapper programStageInstanceMapper = new ProgramStageInstanceMapper(ctx);
final ProgramStageInstance programStageInstance = programStageInstanceMapper.map(event);
auditManager.send(Audit.builder().auditType(getAuditType()).auditScope(AuditScope.TRACKER).createdAt(LocalDateTime.now()).createdBy(eventImporterUserService.getAuditUsername()).object(programStageInstance).auditableEntity(new AuditableEntity(ProgramStageInstance.class, programStageInstance)).build());
}
Aggregations