Package io.jmix.reports.impl
Class ReportExecutionHistoryRecorderImpl
java.lang.Object
io.jmix.reports.impl.ReportExecutionHistoryRecorderImpl
- All Implemented Interfaces:
ReportExecutionHistoryRecorder
@Component("report_ExecutionHistoryRecorder")
public class ReportExecutionHistoryRecorderImpl
extends Object
implements ReportExecutionHistoryRecorder
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentAuthentication
protected DataManager
protected javax.persistence.EntityManager
protected EntityStates
protected FileStorage
protected FileStorageLocator
protected Metadata
protected ReportsProperties
protected SystemAuthenticator
protected TimeSource
protected org.springframework.transaction.support.TransactionTemplate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionShould be invoked as scheduled task.protected FileStorage
protected void
handleSessionExpired
(Runnable action) It is not rare for large reports to execute for a long time.void
markAsCancelled
(ReportExecution execution) void
markAsError
(ReportExecution execution, Exception e) void
markAsSuccess
(ReportExecution execution, com.haulmont.yarg.reporting.ReportOutputDocument document) protected FileRef
saveDocument
(com.haulmont.yarg.reporting.ReportOutputDocument document) protected void
setParametersString
(ReportExecution reportExecution, Map<String, Object> params) protected boolean
shouldSaveDocument
(ReportExecution execution, com.haulmont.yarg.reporting.ReportOutputDocument document) startExecution
(Report report, Map<String, Object> params)
-
Field Details
-
metadata
-
dataManager
-
currentAuthentication
-
timeSource
-
reportsProperties
-
transaction
@Autowired protected org.springframework.transaction.support.TransactionTemplate transaction -
entityManager
protected javax.persistence.EntityManager entityManager -
fileStorageLocator
-
entityStates
-
systemAuthenticator
-
fileStorage
-
-
Constructor Details
-
ReportExecutionHistoryRecorderImpl
public ReportExecutionHistoryRecorderImpl()
-
-
Method Details
-
startExecution
- Specified by:
startExecution
in interfaceReportExecutionHistoryRecorder
-
markAsSuccess
public void markAsSuccess(ReportExecution execution, com.haulmont.yarg.reporting.ReportOutputDocument document) - Specified by:
markAsSuccess
in interfaceReportExecutionHistoryRecorder
-
markAsCancelled
- Specified by:
markAsCancelled
in interfaceReportExecutionHistoryRecorder
-
markAsError
- Specified by:
markAsError
in interfaceReportExecutionHistoryRecorder
-
setParametersString
-
shouldSaveDocument
protected boolean shouldSaveDocument(ReportExecution execution, com.haulmont.yarg.reporting.ReportOutputDocument document) -
saveDocument
protected FileRef saveDocument(com.haulmont.yarg.reporting.ReportOutputDocument document) throws FileStorageException - Throws:
FileStorageException
-
handleSessionExpired
It is not rare for large reports to execute for a long time. In this case when report is finished - user session is already expired and can't be used to make changes to database.- Parameters:
action
- action for the execution
-
cleanupHistory
Description copied from interface:ReportExecutionHistoryRecorder
Should be invoked as scheduled task.- Specified by:
cleanupHistory
in interfaceReportExecutionHistoryRecorder
- Returns:
- count of deleted
ReportExecution
entities
-
getFileStorage
-