Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
firstline1
titleLogging an audit message
linenumberstrue
@AquimaService("EXAMPLE_SERVICE")
public class ExampleService implements IService {
  @Override
  public IServiceResult handle(IServiceContext serviceContext) throws ServiceException, Exception {
 	 final var auditEngine = serviceContext.getAuditEngine();

	 auditEngine.audit(() -> new ExampleAuditMessage(serviceContext.getProfile()));      // This ExampleAuditMessage could for example set all required fields by itself from the profile.
     auditEngine.audit(() -> new ExampleAuditMessage(serviceContext.getProfile()));

     return new ServiceResult("Success");
   }
}

...