Data Processor 'On Save' and Snippets

.. a data processor can now be configured to run on save

.. in addition, the data processor is now passed the operation
   that is triggering it: "Manual", "ADD", "UPDATE", "DELETE",
   "IMPORT".

.. a new data processor has been added to write a JSON file to
   the snippet directory (added to the athlete structure).

.. this is so we can output a snippet every time an activity is
   added, updated or deleted (i.e. runs "on save").

.. these JSON snippets can be used to update external datastores
   where coaches use other analytic software but don't want to
   manually sync GC changes with there external stores.
This commit is contained in:
Mark Liversedge
2016-11-12 22:36:44 +00:00
parent 6965d88cf1
commit a38696e25d
32 changed files with 295 additions and 59 deletions

View File

@@ -23,6 +23,7 @@
#include "RideFileCache.h"
#include "RideCacheModel.h"
#include "Specification.h"
#include "DataProcessor.h"
#include "Route.h"
@@ -296,6 +297,10 @@ RideCache::removeCurrentRide()
return;
}
// dataprocessor runs on "save" which is a short
// hand for add, update, delete
DataProcessorFactory::instance().autoProcess(todelete->ride(), "Save", "DELETE");
// remove from the cache, before deleting it this is so
// any aggregating functions no longer see it, when recalculating
// during aride deleted operation