diff --git a/src/cls/ZPM/Analytics/AbstractEventProcessor.cls b/src/cls/ZPM/Analytics/AbstractEventProcessor.cls new file mode 100644 index 0000000..973d6fe --- /dev/null +++ b/src/cls/ZPM/Analytics/AbstractEventProcessor.cls @@ -0,0 +1,8 @@ +Class ZPM.Analytics.AbstractEventProcessor [ Abstract ] +{ + +ClassMethod Process(event) As %Status [ Abstract ] +{ +} + +} diff --git a/src/cls/ZPM/Analytics/Event.cls b/src/cls/ZPM/Analytics/Event.cls index e04f4c9..59704dd 100644 --- a/src/cls/ZPM/Analytics/Event.cls +++ b/src/cls/ZPM/Analytics/Event.cls @@ -3,7 +3,7 @@ Class ZPM.Analytics.Event Extends (%Persistent, %JSON.Adaptor) Parameter DSTIME = "AUTO"; -/// Server date and time, saving the data +/// Server date and time, saving the data Property TS As %PosixTime(%JSONINCLUDE = "none") [ SqlComputeCode = {set {*}=##class(%Library.PosixTime).CurrentTimeStamp()}, SqlComputed, SqlComputeOnChange = %%INSERT ]; /// Event type: download, install, uninstall @@ -48,8 +48,10 @@ ClassMethod SaveEvent(action As %String, ip As %String = "", json As %DynamicObj Set event.IP = ip Do event.%JSONImport(json) $$$ThrowOnError(event.%Save()) - If ##class(%Dictionary.CompiledClass).%ExistsId("ZPM.Analytics.IP") { - Do ##class(ZPM.Analytics.IP).SetGeo(event, ip) + // get all ZPM.Analytics.AbstractEventProcessor subclasses + set rs = ##class(%Dictionary.ClassDefinitionQuery).SubclassOfFunc("ZPM.Analytics.AbstractEventProcessor") + while (rs.%Next()) { + do $classmethod(rs.%GetData(1), "Process", event) } $$$ThrowOnError(event.%Save()) Return $$$OK