As an administrator
I want to be able to configure the actions on a signal
so that I can easily tailor the workflow without requiring a developer
Current implementation
Currently actions on signals are hardcoded into the backend code. This makes Signalen difficult to tailor for other municipalities. Also a developer is required to make changes to the actions (e.g. changes in the recipient list or categories)
In the code there are two types of actions:
Send an e-mail to a group of recipients
Push signal to Sigmax (currently only triggered manually)
These actions can be limited specific conditions:
Only for predetermined categories or subcategories.
Only limited within a specific period of time (e.g. on Friday and Saturday night within a specific time frame).
This functionality is used for example to send a group of people a notification on
Proposal
We would like to design a new extendible system for actions that can be configured from the Django admin and can easily be extended with new action types.
We propose a new model in Django:
Action
Type, CharField with limited choices (e.g. email or sigmax)
Conditions, JSONField
Args, JSONField
The choices of Type will be resolved dynamically in runtime. In this way a developer can easily create a new action type. Defining a new action type could look something like this.
Args can contain specific configuration for that action, e.g. the list of recipients of the e-mail.
Open questions
Do we want to support nested logic in conditions? In the current proposal we only support the AND operation on root level and one AND/OR operation on sub level. We could consider implementing JsonLogic, Logical JSON operators or something similar.
As an administrator I want to be able to configure the actions on a signal so that I can easily tailor the workflow without requiring a developer
Current implementation
Currently actions on signals are hardcoded into the backend code. This makes Signalen difficult to tailor for other municipalities. Also a developer is required to make changes to the actions (e.g. changes in the recipient list or categories)
In the code there are two types of actions:
These actions can be limited specific conditions:
This functionality is used for example to send a group of people a notification on
Proposal
We would like to design a new extendible system for actions that can be configured from the Django admin and can easily be extended with new action types.
We propose a new model in Django:
Action
The choices of Type will be resolved dynamically in runtime. In this way a developer can easily create a new action type. Defining a new action type could look something like this.
Example of args for email
Args
Conditions can be used to limit the action to a specific category, status or timeframe:
Conditions
Conditions are loosely inspired on IBM's Logical JSON operators. Time roughly follows the crontab definition.
Args can contain specific configuration for that action, e.g. the list of recipients of the e-mail.
Open questions