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
FieldsModifier and TypeFieldDescriptionprotected CurrentAuthenticationprotected DataManagerprotected javax.persistence.EntityManagerprotected EntityStatesprotected FileStorageprotected FileStorageLocatorprotected Metadataprotected ReportsPropertiesprotected SystemAuthenticatorprotected TimeSourceprotected org.springframework.transaction.support.TransactionTemplate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionShould be invoked as scheduled task.protected FileStorageprotected voidhandleSessionExpired(Runnable action) It is not rare for large reports to execute for a long time.voidmarkAsCancelled(ReportExecution execution) voidmarkAsError(ReportExecution execution, Exception e) voidmarkAsSuccess(ReportExecution execution, com.haulmont.yarg.reporting.ReportOutputDocument document) protected FileRefsaveDocument(com.haulmont.yarg.reporting.ReportOutputDocument document) protected voidsetParametersString(ReportExecution reportExecution, Map<String, Object> params) protected booleanshouldSaveDocument(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:
startExecutionin interfaceReportExecutionHistoryRecorder
-
markAsSuccess
public void markAsSuccess(ReportExecution execution, com.haulmont.yarg.reporting.ReportOutputDocument document) - Specified by:
markAsSuccessin interfaceReportExecutionHistoryRecorder
-
markAsCancelled
- Specified by:
markAsCancelledin interfaceReportExecutionHistoryRecorder
-
markAsError
- Specified by:
markAsErrorin 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:ReportExecutionHistoryRecorderShould be invoked as scheduled task.- Specified by:
cleanupHistoryin interfaceReportExecutionHistoryRecorder- Returns:
- count of deleted
ReportExecutionentities
-
getFileStorage
-