/** * @since 7.1 */ private void doCleanAndReschedule(int batchSize, DocumentRoutingService routing, String repositoryName) { int cleanedUpWf = routing.doCleanupDoneAndCanceledRouteInstances(repositoryName, batchSize); if (cleanedUpWf == batchSize) { EventContextImpl eCtx = new EventContextImpl(); eCtx.setProperty(CLEANUP_WORKFLOW_REPO_NAME_PROPERTY, repositoryName); Event event = eCtx.newEvent(CLEANUP_WORKFLOW_EVENT_NAME); EventProducer eventProducer = Framework.getService(EventProducer.class); eventProducer.fireEvent(event); } }