Skip to content
Snippets Groups Projects
Commit f1b92474 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-671: event handling of colums/properties priority_rank and prioritu_queue

parent 5f3a3fc7
No related branches found
No related tags found
1 merge request!715TMSS-671 & TMSS-1135 & TMSS-1332
...@@ -159,6 +159,9 @@ class TMSSPGListener(PostgresListener): ...@@ -159,6 +159,9 @@ class TMSSPGListener(PostgresListener):
self.executeQuery(makePostgresNotificationQueries('', 'tmssapp_project', 'update', id_column_name="name", quote_id_value=True, column_name='project_state_id', quote_column_value=True)) self.executeQuery(makePostgresNotificationQueries('', 'tmssapp_project', 'update', id_column_name="name", quote_id_value=True, column_name='project_state_id', quote_column_value=True))
self.subscribe('tmssapp_project_update_project_state_id', self.onProjectStatusUpdated) self.subscribe('tmssapp_project_update_project_state_id', self.onProjectStatusUpdated)
self.executeQuery(makePostgresNotificationQueries('', 'tmssapp_project', 'update', id_column_name="name", quote_id_value=True, column_name='priority_rank', quote_column_value=False))
self.subscribe('tmssapp_project_update_priority_rank', self.onProjectPriorityRankUpdated)
# ProjectQuotaArchiveLocation # ProjectQuotaArchiveLocation
self.executeQuery(makePostgresNotificationQueries('', 'tmssapp_projectquotaarchivelocation', 'insert')) self.executeQuery(makePostgresNotificationQueries('', 'tmssapp_projectquotaarchivelocation', 'insert'))
self.subscribe('tmssapp_projectquotaarchivelocation_insert', self.onProjectQuotaArchiveLocationInserted) self.subscribe('tmssapp_projectquotaarchivelocation_insert', self.onProjectQuotaArchiveLocationInserted)
...@@ -314,6 +317,10 @@ class TMSSPGListener(PostgresListener): ...@@ -314,6 +317,10 @@ class TMSSPGListener(PostgresListener):
self._sendNotification(TMSS_PROJECT_STATUS_EVENT_PREFIX+'.'+project_status.capitalize(), self._sendNotification(TMSS_PROJECT_STATUS_EVENT_PREFIX+'.'+project_status.capitalize(),
{'name': project_name, 'status': project_status}) {'name': project_name, 'status': project_status})
def onProjectPriorityRankUpdated(self, payload = None):
self._sendNotification(TMSS_PROJECT_OBJECT_EVENT_PREFIX+'.PriorityRank.Updated', payload)
def onProjectQuotaArchiveLocationInserted(self, payload = None): def onProjectQuotaArchiveLocationInserted(self, payload = None):
self._sendNotification(TMSS_PROJECTQUOTAARCHIVELOCATION_OBJECT_EVENT_PREFIX+'.Created', payload) self._sendNotification(TMSS_PROJECTQUOTAARCHIVELOCATION_OBJECT_EVENT_PREFIX+'.Created', payload)
......
...@@ -128,6 +128,8 @@ class TMSSEventMessageHandler(AbstractMessageHandler): ...@@ -128,6 +128,8 @@ class TMSSEventMessageHandler(AbstractMessageHandler):
self.onProjectStatusUpdated(**msg.content) self.onProjectStatusUpdated(**msg.content)
elif stripped_subject == 'Project.Object.Deleted': elif stripped_subject == 'Project.Object.Deleted':
self.onProjectDeleted(**msg.content) self.onProjectDeleted(**msg.content)
elif stripped_subject == 'Project.Object.PriorityRank.Updated':
self.onProjectPriorityRankUpdated(**msg.content)
elif stripped_subject == 'ProjectQuotaArchiveLocation.Object.Created': elif stripped_subject == 'ProjectQuotaArchiveLocation.Object.Created':
self.onProjectQuotaArchiveLocationCreated(**msg.content) self.onProjectQuotaArchiveLocationCreated(**msg.content)
elif stripped_subject == 'ProjectQuotaArchiveLocation.Object.Updated': elif stripped_subject == 'ProjectQuotaArchiveLocation.Object.Updated':
...@@ -307,6 +309,11 @@ class TMSSEventMessageHandler(AbstractMessageHandler): ...@@ -307,6 +309,11 @@ class TMSSEventMessageHandler(AbstractMessageHandler):
''' '''
pass pass
def onProjectPriorityRankUpdated(self, name: str, priority_rank: float):
'''onProjectPriorityRankUpdated is called upon receiving a Project.PriorityRank.Updated message, which is sent when a Project was assigned a new priority_rank.
'''
pass
def onProjectDeleted(self, name: str): def onProjectDeleted(self, name: str):
'''onProjectDeleted is called upon receiving a Project.Object.Deleted message, which is sent when a Project was created. '''onProjectDeleted is called upon receiving a Project.Object.Deleted message, which is sent when a Project was created.
''' '''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment