Package io.nflow.engine.service
Class MaintenanceService
java.lang.Object
io.nflow.engine.service.MaintenanceService
Service for deleting and archiving old workflow instances from nflow-tables and nflow_archive-tables.
-
Constructor Summary
ConstructorsConstructorDescriptionMaintenanceService(MaintenanceDao maintenanceDao, TableMetadataChecker tableMetadataChecker, WorkflowDefinitionService workflowDefinitionService, ExecutorDao executorDao) -
Method Summary
Modifier and TypeMethodDescriptionintcleanupExecutors(org.joda.time.ReadablePeriod deleteExpiredExecutorsOlderThan) Delete workflow executors that have expired [given period] ago.cleanupWorkflows(MaintenanceConfiguration configuration) Cleans up old (whose modified time is earlier thanolderThanPeriodparameter) and passive (that do not havenextActivation) workflows.
-
Constructor Details
-
MaintenanceService
@Inject public MaintenanceService(MaintenanceDao maintenanceDao, TableMetadataChecker tableMetadataChecker, WorkflowDefinitionService workflowDefinitionService, ExecutorDao executorDao)
-
-
Method Details
-
cleanupWorkflows
Cleans up old (whose modified time is earlier thanolderThanPeriodparameter) and passive (that do not havenextActivation) workflows. Copies workflow instances, actions and state variables to corresponding archive tables and removes them from production and archive tables as requested.- Parameters:
configuration- Cleanup actions to be executed and parameters for the actions.- Returns:
- Object describing the number of workflows acted on.
-
cleanupExecutors
public int cleanupExecutors(org.joda.time.ReadablePeriod deleteExpiredExecutorsOlderThan) Delete workflow executors that have expired [given period] ago.- Parameters:
deleteExpiredExecutorsOlderThan- Time to wait before expired executors get deleted.- Returns:
- Number of executors deleted.
-