use of io.jmix.reports.entity.ReportExecution in project jmix by jmix-framework.
the class ReportRunnerImpl method run.
@Override
public ReportOutputDocument run(ReportRunContext context) {
prepareContext(context);
if (!reportsProperties.isHistoryRecordingEnabled()) {
return createReportDocumentInternal(context);
}
ReportExecution reportExecution = executionHistoryRecorder.startExecution(context.getReport(), context.getParams());
try {
ReportOutputDocument document = createReportDocumentInternal(context);
executionHistoryRecorder.markAsSuccess(reportExecution, document);
return document;
} catch (ReportCanceledException e) {
executionHistoryRecorder.markAsCancelled(reportExecution);
throw e;
} catch (Exception e) {
executionHistoryRecorder.markAsError(reportExecution, e);
throw e;
}
}
use of io.jmix.reports.entity.ReportExecution in project jmix by jmix-framework.
the class ReportExecutionHistoryRecorderImpl method startExecution.
@Override
public ReportExecution startExecution(Report report, Map<String, Object> params) {
ReportExecution execution = metadata.create(ReportExecution.class);
execution.setReport(report);
execution.setReportName(report.getName());
execution.setReportCode(report.getCode());
execution.setUsername(currentAuthentication.getUser().getUsername());
execution.setStartTime(timeSource.currentTimestamp());
setParametersString(execution, params);
handleNewReportEntity(execution);
execution = dataManager.save(execution);
return execution;
}
Aggregations