Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampliar funcionalidad #9

Open
hhkaos opened this issue Apr 15, 2016 · 4 comments
Open

Ampliar funcionalidad #9

hhkaos opened this issue Apr 15, 2016 · 4 comments

Comments

@hhkaos
Copy link
Contributor

hhkaos commented Apr 15, 2016

Last update: 1 June 2016

Actualmente el tipo de flujos y condiciones/criterios para el envío de notificaciones tiene limitaciones:

  • No permite configurar un trigger para la situación de que se dispare cuando se de una combinación de valores en diferentes campos simultaneamente
  • No se almacena un histórico de estados, envíos por los que ha pasado la geometría
  • No se pueden configurar triggers para múltiples capas/servicios en el mismo script
  • No se puede configurar el trigger en función del tipo de acción realizado sobre la geometría (nueva, edición, cualquiera) (sólo funciona para ediciones)
  • No se pueden configurar triggers en función del usuario

Para ello se propone esta nueva estructura del campo "flow" renombrado a "settings" para que se pueda ampliar los casos de uso que puede cubrir el script:

"settings": {
  services:[
    {
      "item": "<item-id>",
      "layer": "<item-index>",
      "triggers":[
        {
          "action": <"any" | "added" | "edited">,
          "users": <["<username>", ...] | "any">,
          "role": <["<role-name>", ...] | "any">,
          "groups": <["<group-name>", ...] | "any">,
          "excludeCondition":{
            "type": <"all" | "any">,
            "conditions":[
              {
                "field": "<field-name>",
                "value": < "<field-value>" | "any">
              },
              ...
            ]
          },
          "meetCondition": {
            type: <"all" | "any">,
            "conditions": [
              {
                "field": "<field-name>",
                "value": < "<field-value>" | "any">
              },
              ...
            ],
          },
          "email":{
            "from": "<from-email>",
            "to": "<to-email>",
            "subject": "<subject>",
            "body": "<body>",
          }
        },
        ...
      ]
    }...
  ],
  "metadata": {
    "lastEmailedUser": "<field-name>",
    "lastEmailDate": "<field-name>",
    "history": {
      "activate": <true | false>,
      "field": "<field-name>"
    }
  }
},

En el campo history se puede ir guardar/actualizando un JSON con información de los estados que han disparado notificaciones:

  • Cuando
  • A quién
  • Condiciones que se dieron para el disparo
  • etc.
@Cintruenigo
Copy link

I added #12 as a separate issue to break down this use case (notify user when feature is created) and provide some context.

@hhkaos
Copy link
Contributor Author

hhkaos commented Apr 21, 2016

Great, thx! 👏

@hhkaos
Copy link
Contributor Author

hhkaos commented May 24, 2016

Updated to add the possibility to check multiple item/features in one configuration.

"settings": {
  services:[
    {
      "item": "<item-id>",
      "layer": "<item-index>",
    }...
  ],
  ...
}

@hhkaos
Copy link
Contributor Author

hhkaos commented Jun 1, 2016

I just updated the config settings, now:

  • Triggers are related to each layer
  • Conditions also have a "mode" in order to meet the criteria with all conditions are true or when any condition is true
  • There are also two kind of conditions, one to exclude features that doesn't need to be checked (excludeCondition) and trigger conditions for notifications (meetCondition)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants