4949public class DocumentImportScheduler implements Scheduler {
5050
5151 public static final String DOCUMENT_IMPORTER_NAME = "DOCUMENT_IMPORTER" ;
52-
52+
5353 @ EJB
5454 DocumentImportService documentImportService ;
55-
55+
5656 @ Inject
5757 protected Event <DocumentImportEvent > importEvents ;
5858
@@ -64,7 +64,6 @@ public class DocumentImportScheduler implements Scheduler {
6464 * process the source. If a event returns PROCESSING_RESULT_COMPLETED = 1 than
6565 * no more events will be fired for this source.
6666 *
67- *
6867 * @param timer
6968 * @throws SchedulerException
7069 * @throws QueryException
@@ -73,10 +72,13 @@ public class DocumentImportScheduler implements Scheduler {
7372 public ItemCollection run (ItemCollection configuration ) throws SchedulerException {
7473
7574 if (importEvents != null ) {
75+ // disable snapshot
76+ configuration .setItemValue ("$nosnapshot" , true );
7677 // load all sources
7778 List <ItemCollection > sources = documentImportService .loadSourcesFromConfiguration (configuration );
7879 if (sources .size () > 0 ) {
79- documentImportService .logMessage ("Document import starting - " + sources .size () + " sources found..." , configuration );
80+ documentImportService .logMessage ("Document import starting - " + sources .size () + " sources found..." ,
81+ configuration );
8082 for (ItemCollection source : sources ) {
8183 // Finally fire the DocumentImportEvent. This allows CDI Observers to process
8284 // the import
@@ -88,7 +90,7 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
8890 logger .severe ("...Document Import Error" );
8991 }
9092 }
91-
93+
9294 // update sources (a CDI bean may have added new data....)
9395 // convert the option ItemCollection elements into a List of Map
9496 List <Map > mapItemList = new ArrayList <Map >();
@@ -97,8 +99,7 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
9799 mapItemList .add (orderItem .getAllItems ());
98100 }
99101 configuration .replaceItemValue (DocumentImportService .ITEM_SOURCES , mapItemList );
100-
101-
102+
102103 documentImportService .logMessage ("Document import completed." , configuration );
103104 } else {
104105 documentImportService .logMessage ("No sources defined." , configuration );
@@ -108,5 +109,4 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
108109 return configuration ;
109110 }
110111
111-
112112}
0 commit comments