@@ -3,7 +3,7 @@ Class ZPM.Analytics.Event Extends (%Persistent, %JSON.Adaptor)
3
3
4
4
Parameter DSTIME = " AUTO" ;
5
5
6
- /// Server date and time, saving the data
6
+ /// Server date and time, saving the data
7
7
Property TS As %PosixTime (%JSONINCLUDE = " none" ) [ SqlComputeCode = {set {*}=##class (%Library.PosixTime ).CurrentTimeStamp ()}, SqlComputed , SqlComputeOnChange = %%INSERT ];
8
8
9
9
/// Event type: download, install, uninstall
@@ -40,6 +40,22 @@ Property Region As %String(%JSONINCLUDE = "none");
40
40
41
41
Property City As %String (%JSONINCLUDE = " none" );
42
42
43
+ ClassMethod ExecuteEventProcessors (event As ZPM .Analytics .Event ) As %Status
44
+ {
45
+ Set subclasses = $PARAMETER (" ZPM.Analytics.AbstractEventProcessor" ," SubClasses" )
46
+ Set list = $ListFromString (subclasses ," ," )
47
+ For i =1 :1 :$listlength (list ){
48
+ Try {
49
+ $$$ThrowOnError($Classmethod ($listget (list ,i ), " Process" , event ))
50
+ } Catch ex {
51
+ If (ex .Name '= " <CLASS DOES NOT EXIST>" ) {
52
+ Throw ex
53
+ }
54
+ }
55
+ }
56
+ return $$$OK
57
+ }
58
+
43
59
ClassMethod SaveEvent (action As %String , ip As %String = " " , json As %DynamicObject ) As %Status
44
60
{
45
61
Try {
@@ -48,10 +64,7 @@ ClassMethod SaveEvent(action As %String, ip As %String = "", json As %DynamicObj
48
64
Set event .IP = ip
49
65
Do event .%JSONImport (json )
50
66
$$$ThrowOnError(event .%Save ())
51
- If ##class (%Dictionary.CompiledClass ).%ExistsId (" ZPM.Analytics.IP" ) {
52
- Do ##class (ZPM.Analytics.IP ).SetGeo (event , ip )
53
- }
54
- $$$ThrowOnError(event .%Save ())
67
+ $$$ThrowOnError(..ExecuteEventProcessors (event ))
55
68
Return $$$OK
56
69
} Catch ex {
57
70
Do ex .Log ()
0 commit comments