Service - Notification Manager: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(10 intermediate revisions by 2 users not shown)
Line 7: Line 7:
= Repository =
= Repository =


https://bitbucket.org/stb_working/notification-manager/src/master/
https://bitbucket.org/izara-core-shared/izara-core-shared-notification-manager
 
= DynamoDB tables =
 
== PendingConsolidation Table ==
 
; partition key
* notificationGroupId
: type: string
: comes from: random UUID
; sort key
* time
: type: number
: {timestamp activity handled in Activity Switchboard}_{small random UUID}


= Object Schemas =
= Object Schemas =
Line 30: Line 17:
=== notificationGroup ===
=== notificationGroup ===


* Groups many notificatons together
* Groups many triggerGroups together
* Simplifies management of similar notifications
* Allows for consolidation of notifications at notification group level


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
objectType: "notificationGroup",
objectType: "notificationGroup",
canDelete: false,
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
    complexFilterServiceTag: "complexFilter",
create: ['hdrSqs'], // default: ['hdrApi', 'hdrSqs']
update: ['hdrSqs'], // default: ['hdrApi', 'hdrSqs']
get: [], // default: ['hdrApi', 'hdrInv']
delete: [], // default: ['hdrApi', 'hdrSqs']
},
overwriteGeneratedMainFunction: ["get", "delete"],
addOnDataStructure: [
addOnDataStructure: [
{
{
Line 48: Line 38:
fieldName: "notificationGroupName",
fieldName: "notificationGroupName",
type: "string",
type: "string",
requiredOnCreate: true, // default = false
optionalOnCreate: true, // default = false
optionalOnCreate: true, // default = false
canUpdate: true, // default = true
canUpdate: true, // default = true
Line 55: Line 44:
}
}
},
},
{  
{
fieldName: "consolidated",
fieldName: "consolidatedType",
type: "boolean",
type: "string",
requiredOnCreate: true,
optionalOnCreate: true,
optionalOnCreate: true,
canUpdate: true,
canUpdate: true,
validation: {
validation: {
Line 66: Line 54:
},
},
{
{
fieldName: "consolidatedType",
fieldName: "consolidatedFrequency",
type: "string",
type: "string",
requiredOnCreate: true,
optionalOnCreate: true,
optionalOnCreate: true,
canUpdate: true,
canUpdate: true,
validation: {
validation: {
Line 76: Line 63:
},
},
{
{
fieldName: "consolidatedFrequency",
fieldName: "consolidatedNextSendDue",
type: "string",
type: "number",
requiredOnCreate: true,
optionalOnCreate: true,
optionalOnCreate: true,
canUpdate: true,
canUpdate: true,
validation: {
validation: {
Line 88: Line 74:
fieldName: "consolidatedSendIfEmpty",
fieldName: "consolidatedSendIfEmpty",
type: "boolean",
type: "boolean",
requiredOnCreate: true,
optionalOnCreate: true,
optionalOnCreate: true,
canUpdate: true,
canUpdate: true,
validation: {
validation: {
Line 98: Line 83:
}
}
     ],
     ],
    overwriteGeneratedMainFunction: ["create", "get", "update"],
     storageResources: {
     storageResources: {
myGraph: {
myGraph: {
Line 108: Line 92:
notificationGroupId: {
notificationGroupId: {
    type: "string",
    type: "string",
optionalOnCreate: true,
randomOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
receiverTag: {
type: "string",
requiredOnCreate: true,
optionalOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
additionalData: {
type: "object",
optionalOnCreate: true,
requiredOnCreate: true,
canUpdate: false,
canUpdate: false,
validation: {
validation: {
Line 148: Line 112:


; notificationGroupId (identifier)
; notificationGroupId (identifier)
: comes from: random UUID
: comes from: hash{notifications}
; notificationGroupName
; notificationGroupName
: string name set by reciever service, optional
: string name set by reciever service, optional
; additionalData
; consolidated (maybe remove and use '''consolidatedType''' for check consolidated )
: set by the creating service, gets added to notifications sent to the receiver
: true | false
: eg: can include the actual userId and used to make the groupingId
; receiverTag
: set by the creating service
: eg ContactMethodEmail
; consolidated
: true|false
: optional, if excluded (or value not true), defaults to false
; consolidatedType
; consolidatedType
: overview|detailed
: overview | detailed | null
: ''overview'' sends a count of each type of notification, ''detailed'' lists each activity message
: ''overview'' sends a count of each type of notification, ''detailed'' lists each activity message
: ''null'' that mean notificationGroup is not consolidated and send to receiver service
; consolidatedFrequency
; consolidatedFrequency
: not sure, maybe use some sort of standard like cron
: not sure, maybe use some sort of standard like cron
Line 168: Line 126:
: timestamp for next due time to send notification
: timestamp for next due time to send notification
; consolidatedSendIfEmpty
; consolidatedSendIfEmpty
: true|false
: true | false
 
 
=== notification ===
 
<syntaxhighlight lang="JavaScript">
{
objectType: "notification",
canDelete: false,
complexFilterServiceTag: "complexFilter",
addOnDataStructure: [
{
type: "versionedData",
versionedDataLabel: "notificationSettings",
storageResourceTag: "myGraph",
fieldNames: [
{ // fieldName in versionedData should now same in main objectSchema
fieldName: "notificationName",
type: "string",
requiredOnCreate: true, // default = false
optionalOnCreate: true, // default = false
canUpdate: true, // default = true
validation: {
pattern: pattern
}
}
]
}
    ],
    overwriteGeneratedMainFunction: ["create", "get", "update"],
    storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
    },
    fieldNames: {
notificationId: {
    type: "string",
optionalOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
    },
    identifiers: [
{
type: "identifier",
fieldName: "notificationId"
}
    ]
}
</syntaxhighlight>
 
==== fieldNames ====
 
; notificationId (identifier)
: comes from: random UUID
; notificationName
: string name set by reciever service, optional
 
 
=== notificationTrigger ===
 
<syntaxhighlight lang="JavaScript">
{
objectType: "notificationTrigger",
canDelete: false,
    complexFilterServiceTag: "complexFilter",
    overwriteGeneratedMainFunction: ["create", "get"],
    storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
    },
    fieldNames: {
notificationTriggerId: {
type: "string",
optionalOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
}
},
propertyName: {
type: "string",
requiredOnCreate: true,
optionalOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
valueType: {
type: "string",
requiredOnCreate: true,
optionalOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
value: {
type: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // can be "string" or "number"
optionalOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
values: {
type: "arrayMixed",
optionalOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
}
    },
    identifiers: [
{
type: "identifier",
fieldName: "notificationTriggerId"
}
    ]
}
</syntaxhighlight>
 
==== fieldNames ====
 
; notificationTriggerId (identifier)
: comes from: random UUID
; propertyName
: can be a nested property, use dot notation
: "serviceName" and "topicName" valueTypes do not have propertyName
; valueType
: property|attribute|serviceName|topicName
; value
: '''type: string or number'''
; values
: '''type: array/list of value (arrayMixed??)'''
 


=== consolidated ===
=== consolidated ===
Line 327: Line 135:
canDelete: false,
canDelete: false,
     complexFilterServiceTag: "complexFilter",
     complexFilterServiceTag: "complexFilter",
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
create: [], // default: ['hdrApi', 'hdrSqs']
update: [],      // default: ['hdrApi', 'hdrSqs']
get: [], // default: ['hdrApi', 'hdrInv']
delete: [], // default: ['hdrApi', 'hdrSqs']
},
     storageResources: {
     storageResources: {
dynamoDB: {
dynamoDB: {
storageType: "dynamoDB",
storageType: "dynamoDB",
graphServerTag: "PendingConsolidation"
tableName: "PendingConsolidation"
}
}
     },
     },
Line 336: Line 150:
notificationGroupId: {
notificationGroupId: {
type: "string",
type: "string",
requiredOnCreate: true,
optionalOnCreate: true,
canUpdate: false,
canUpdate: false,
validation: {
storageResourceTags: ['dynamoDB'],
pattern: pattern
fromServiceNameTag: "NotificationManager" ,
},
fromObjectType: "notificationGroup"
storageResourceTags: ['dynamoDB']
},
},
time: {
time: {
type: "number",
type: "string",
requiredOnCreate: true,
requiredOnCreate: true,
optionalOnCreate: true,
canUpdate: false,
canUpdate: false,
validation: {
validation: {
Line 357: Line 167:
type: "object",
type: "object",
requiredOnCreate: true,
requiredOnCreate: true,
optionalOnCreate: true,
canUpdate: false,
canUpdate: false,
validation: {
validation: {
Line 381: Line 190:


; notificationGroupId (partition key)
; notificationGroupId (partition key)
: comes from: random UUID
: comes from: hash{notifications}
; time (sort key)
; time (sort key)
: comes from {timestamp activity handled in Activity Switchboard}_{small random UUID}
: comes from {timestamp activity handled in Activity Switchboard}_{small random UUID}
Line 391: Line 200:
== Object Relationships ==
== Object Relationships ==


=== has_notificationGroup ===
=== ownsNotificationGroup ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
"has_notificationGroup": {
"ownsNotificationGroup": {
properties: {
fieldNames: {
originTimestamp: {...}
"originTimestamp": {
    type: "number",            // "string" | "number" ...
requiredOnCreate: true,  // default = false
canUpdate: true,          // default = true
validation: {}            // ajv syntax
}
},
},
storageResources: {
storageResources: {
Line 409: Line 223:
from: {
from: {
objType: {
objType: {
serviceTag: "ContactMethodEmail",
serviceTag: "UserAccount",
objectType: "email"
objectType: "user"
},
},
linkType: "one",
linkType: "one",
Line 416: Line 230:
to: {
to: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "NotificationManager",
objType: "notificationGroup"
objectType: "notificationGroup"
},
},
requiredOnCreate: true,
requiredOnCreate: true,
Line 428: Line 242:
}
}
</syntaxhighlight>
</syntaxhighlight>
: links email to notificationGroup
: links user to notificationGroup that user created


=== disabled_notificationGroup ===
=== hasNotificationGroup ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
"disabled_notificationGroup": {
"hasNotificationGroup": {
properties: {
fieldNames: {
originTimestamp: {...}
"originTimestamp": {
    type: "number",            // "string" | "number" ...
requiredOnCreate: true,  // default = false
canUpdate: true,          // default = true
validation: {}            // ajv syntax
}
},
},
storageResources: {
storageResources: {
Line 448: Line 267:
from: {
from: {
objType: {
objType: {
serviceTag: "ContactMethodEmail",
serviceTag: "UserContactManager",
objectType: "email"
objectType: "userContact"
},
},
linkType: "one"
linkType: "many"
},
},
to: {
to: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "NotificationManager",
objType: "notificationGroup"
objectType: "notificationGroup"
},
},
linkType: "many",
linkType: "many",
Line 467: Line 286:
</syntaxhighlight>
</syntaxhighlight>


 
=== disabledNotificationGroup ===
=== has_notification ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
"has_notification": {
"disabledNotificationGroup": {
properties: {
fieldNames: {
originTimestamp: {...}
"originTimestamp": {
    type: "number",            // "string" | "number" ...
requiredOnCreate: true,  // default = false
canUpdate: true,          // default = true
validation: {}            // ajv syntax
}
},
},
storageResources: {
storageResources: {
Line 486: Line 309:
from: {
from: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "UserContactManager",
objectType: "notificationGroup"
objectType: "userContact"
},
},
linkType: "one",
linkType: "many"
handler: true
},
},
to: {
to: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "NotificationManager",
objType: "notification"
objectType: "notificationGroup"
},
},
requiredOnCreate: true,
linkType: "many",
linkType: "many",
handler: true
handler: true
Line 507: Line 328:
</syntaxhighlight>
</syntaxhighlight>


 
=== hasTriggerGroup ===
=== disabled_notification ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
"disabled_notification": {
"hasTriggerGroup": {
properties: {
fieldNames: {
originTimestamp: {...}
"originTimestamp": {
    type: "number",            // "string" | "number" ...
requiredOnCreate: true,  // default = false
canUpdate: true,          // default = true
validation: {}            // ajv syntax
}
},
},
storageResources: {
storageResources: {
myGraph: {
myGraph: {
storageType: "graph",
storageType: "graph",
graphServerTag: "graphHandler"
graphServerTag: "GraphHandler"
}
}
},
},
Line 526: Line 351:
from: {
from: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "NotificationManager",
objectType: "notificationGroup"
objectType: "notificationGroup"
},
},
linkType: "one",
linkType: "many",
handler: true
handler: true
},
},
to: {
to: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "ActivitySwitchboard",
objType: "notification"
objectType: "triggerGroup"
},
},
linkType: "many",
linkType: "many"
handler: true
}
}
}
}
Line 546: Line 370:
</syntaxhighlight>
</syntaxhighlight>


 
=== disabledTriggerGroup ===
=== has_notificationTrigger ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
"has_notificationTrigger": {
"disabledTriggerGroup": {
properties: {
fieldNames: {
originTimestamp: {...}
"originTimestamp": {
    type: "number",            // "string" | "number" ...
requiredOnCreate: true,  // default = false
canUpdate: true,          // default = true
validation: {}            // ajv syntax
}
},
},
storageResources: {
storageResources: {
Line 565: Line 393:
from: {
from: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "NotificationManager",
objectType: "notification"
objectType: "notificationGroup"
},
linkType: "one",
handler: true
},
to: {
objType: {
serviceTag: "NotificationMgr",
objType: "notificationTrigger"
},
},
requiredOnCreate: true,
linkType: "many",
linkType: "many",
handler: true
}
}
]
}
}
</syntaxhighlight>
=== disabled_notificationTrigger ===
<syntaxhighlight lang="JavaScript">
{
"disabled_notificationTrigger": {
properties: {
originTimestamp: {...}
},
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "graphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "NotificationMgr",
objectType: "notification"
},
linkType: "one",
handler: true
handler: true
},
},
to: {
to: {
objType: {
objType: {
serviceTag: "NotificationMgr",
serviceTag: "ActivitySwitchboard",
objType: "notificationTrigger"
objectType: "triggerGroup"
},
},
linkType: "many",
linkType: "many"
handler: true
}
}
}
}
Line 625: Line 412:
</syntaxhighlight>
</syntaxhighlight>


== value or values array ==
= value or values array =


* Either 'value' or 'values' should be set, not both, if 'values' is used it means any of the elements in the 'values' array can match.
* Either 'value' or 'values' should be set, not both, if 'values' is used it means any of the elements in the 'values' array can match.

Revision as of 06:27, 19 March 2025

Overview

Consolidates and sends notifications to any number of receiver services. Will be used for user notifications but can have other types of receiver services added. Activities are received from Activity Switchboard service.

Notification groups set whether activities are considated (eg per day/per month/per x number of activities), if considated activities are stored here until sending is triggered, according to the considation rules. If not consolidated they are sent on immediately.

Repository

https://bitbucket.org/izara-core-shared/izara-core-shared-notification-manager

Object Schemas

Additional Information
Per Service Schemas

objType

notificationGroup

  • Groups many triggerGroups together
{
	objectType: "notificationGroup",
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
		create: ['hdrSqs'], 	// default: ['hdrApi', 'hdrSqs']
		update: ['hdrSqs'], 	// default: ['hdrApi', 'hdrSqs']
		get: [], 				// default: ['hdrApi', 'hdrInv']
		delete: [], 			// default: ['hdrApi', 'hdrSqs']
	},
	overwriteGeneratedMainFunction: ["get", "delete"],
	addOnDataStructure: [
		{
			type: "versionedData",
			versionedDataLabel: "notificationGroupSettings",
			storageResourceTag: "myGraph",
			fieldNames: [
				{ // fieldName in versionedData should now same in main objectSchema
			 		fieldName: "notificationGroupName",
			 		type: "string",
					optionalOnCreate: true, 				// default = false
					canUpdate: true, 						// default = true
					validation: {
						pattern: pattern
					}
				},
				{
					fieldName: "consolidatedType",
			 		type: "string",
					optionalOnCreate: true, 								
					canUpdate: true, 						
					validation: {
						pattern: pattern
					}
				},
				{
					fieldName: "consolidatedFrequency",
			 		type: "string",
					optionalOnCreate: true, 								
					canUpdate: true, 						
					validation: {
						pattern: pattern
					}
				},
				{
					fieldName: "consolidatedNextSendDue",
			 		type: "number",
					optionalOnCreate: true, 								
					canUpdate: true, 						
					validation: {
						pattern: pattern
					}
				},
				{
					fieldName: "consolidatedSendIfEmpty",
			 		type: "boolean",
					optionalOnCreate: true, 				 				
					canUpdate: true, 						
					validation: {
						pattern: pattern
					}
				}
			]
		}
    ],
    storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
    },
    fieldNames: { // see Per Service Schemas
		notificationGroupId: {
		    type: "string",
			randomOnCreate: true,
			canUpdate: false,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['myGraph']
		}
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "notificationGroupId"
		}
    ]
}

fieldNames

notificationGroupId (identifier)
comes from: hash{notifications}
notificationGroupName
string name set by reciever service, optional
consolidated (maybe remove and use consolidatedType for check consolidated )
true | false
consolidatedType
overview | detailed | null
overview sends a count of each type of notification, detailed lists each activity message
null that mean notificationGroup is not consolidated and send to receiver service
consolidatedFrequency
not sure, maybe use some sort of standard like cron
consolidatedNextSendDue
timestamp for next due time to send notification
consolidatedSendIfEmpty
true | false

consolidated

{
	objectType: "consolidated",
	canDelete: false,
    complexFilterServiceTag: "complexFilter",
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
		create: [], 	 // default: ['hdrApi', 'hdrSqs']
		update: [],      // default: ['hdrApi', 'hdrSqs']
		get: [], 		 // default: ['hdrApi', 'hdrInv']
		delete: [], 	 // default: ['hdrApi', 'hdrSqs']
	},
    storageResources: {
		dynamoDB: {
			storageType: "dynamoDB",
			tableName: "PendingConsolidation"
		}
    },
    fieldNames: {
		notificationGroupId: {
			type: "string",
			canUpdate: false,
			storageResourceTags: ['dynamoDB'],
			fromServiceNameTag: "NotificationManager" ,
			fromObjectType: "notificationGroup"
		},
		time: {
			type: "string",
			requiredOnCreate: true,
			canUpdate: false,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['dynamoDB']		
		},
		activityMsg: {
			type: "object",
			requiredOnCreate: true,
			canUpdate: false,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['dynamoDB']		
		}
    },
    identifiers: [
		{
			type: "partitionKey",
			fieldName: "notificationGroupId"
		},
		{
			type: "sortKey",
			fieldName: "time"
		}
    ]
}

fieldNames

notificationGroupId (partition key)
comes from: hash{notifications}
time (sort key)
comes from {timestamp activity handled in Activity Switchboard}_{small random UUID}
adding the UUID to ensure no clashing records with the same timestamp and notificationGroupId
activityMsg
copy of the message delivered from Activity Switchboard


Object Relationships

ownsNotificationGroup

{
	"ownsNotificationGroup": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: true,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "graphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "UserAccount",					
						objectType: "user"
					},
					linkType: "one",
				},
				to: {
					objType: {
						serviceTag: "NotificationManager",				
						objectType: "notificationGroup"					
					},
					requiredOnCreate: true,					
					linkType: "many",
					handler: true
				}
			}
		]
	}
}
links user to notificationGroup that user created

hasNotificationGroup

{
	"hasNotificationGroup": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: true,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "UserContactManager",					
						objectType: "userContact"
					},
					linkType: "many"
				},
				to: {
					objType: {
						serviceTag: "NotificationManager",				
						objectType: "notificationGroup"					
					},			
					linkType: "many",
					handler: true
				}
			}
		]
	}
}

disabledNotificationGroup

{
	"disabledNotificationGroup": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: true,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "UserContactManager",					
						objectType: "userContact"
					},
					linkType: "many"
				},
				to: {
					objType: {
						serviceTag: "NotificationManager",				
						objectType: "notificationGroup"					
					},			
					linkType: "many",
					handler: true
				}
			}
		]
	}
}

hasTriggerGroup

{
	"hasTriggerGroup": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: true,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "NotificationManager",					
						objectType: "notificationGroup"
					},
					linkType: "many",
					handler: true					
				},
				to: {
					objType: {
						serviceTag: "ActivitySwitchboard",				
						objectType: "triggerGroup"					
					},				
					linkType: "many"
				}
			}
		]
	}
}

disabledTriggerGroup

{
	"disabledTriggerGroup": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: true,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "graphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "NotificationManager",					
						objectType: "notificationGroup"
					},
					linkType: "many",
					handler: true
				},
				to: {
					objType: {
						serviceTag: "ActivitySwitchboard",				
						objectType: "triggerGroup"					
					},
					linkType: "many"
				}
			}
		]
	}
}

value or values array

  • Either 'value' or 'values' should be set, not both, if 'values' is used it means any of the elements in the 'values' array can match.
  • To achieve this on Activity Switchboard a new trigger group is created for each element, each activity group has the full list of other triggers, and one option from this trigger's values array. If a notification has multiple values type triggers than a new trigger group on Activity Switchboard is created for each combination.
  • "serviceName" and "topicName" valueTypes do not have propertyName

serviceName and topicName triggers

  • Notifications do not have to set their serviceName and/or topicName, if not set then any message that matches the properties will pass
  • Can set only the serviceName, then any message that passess the properties and is from that serviceName passes
  • Can set serviceName+topicName, then only messages in that topic will pass
  • serviceName and topicName can both be submitted as "values" array, creating multiple trigger groups for each combination

Consolidated notifications

How to trigger processing for time based consolidations

  • ....
  • maybe can use some sort of queue to store a list of NotificationGroup’s that are due to be sent (either because consolidatedSendIfEmpty == true or there are some activities waiting to be processed)

Formating the notification body

  • Initially the format will be hardwired and simple, but in the future we could create templates for formating the notification body
  • The notificationBody is currently sent to receiver as a JSON stringified object containing all activityMsgs

Ideas

  • overview notifications currently count per notification, but could be extended to do aggregates on a per notification, per field level
  • If set to overview maybe can store just aggregate/s needed for the consolidated notification, at the moment store entire messages, create the overview once when sending notification

Working documents

Working documents - Notification Manager