Notifications

Introdution

Use case: When shipping material from the warehouse, the system automatically sends an email to notify the Customer.

In Genio, to carry out the type of procedure described above, Notifications are used.

To make a Notification for this case, we need to follow the following steps

  1. Defining the business criteria to get all shipping records for materials for which a message has not yet been sent.
  2. Querying the application database to provide data that meets business criteria. The query will also serve to define which fields will be used as tags in the composition of the message to be sent to recipients.
  3. Creating the Recipients of the messages sent by the application.
  4. Composing the Notification, selecting the business criteria, defining tags to compose the message, and defining the message recipients.
  5. Building a repository table, if necessary, with the history of sent messages (optional).
  6. After creating the application, it will be necessary to configure, in the administration portal WebAdmin:
    1. The e-mail server for sending messages
    2. Configuration of notifications
    3. Building templates of messages to be sent
  7. When configuring notifications, templates of messages to be sent are built. Each template defines the message, the e-mail server to be used for sending it, its signature, and other parameters referring to the way the message is sent.
  8. Configuration of the QuidServer message sending scheduling service.

Warehouse Management System

We will use the Dispatch of goods area of the Warehouse Management System made with Genio to exemplify how to configure notifications.

Below we show in the application made by Genio, the visualization of a list with Dispatch of goods.

Imagem

Dispatch of goods form where the details of the client Entity, the Person responsible for preparation, and the date and number of shipment of the goods are filled out as well the preparation date.

Imagem

Genio Project Definitions

The Genio project with the definitions of the Warehouse Management System has the system acronym NFO, and therefore all tables defined in Genio have the NFO prefix added to the table name in the query to the data schema in SQLServer.

Imagem

DISPATCH(DISPA) table defined in Genio is accessed in the SQL server as being NFODISPATCH table.

Imagem

Imagem

Application data structure

Presentation of Relational Model where the DISPATCH (DISPA) table is related in an N:1 relationship with the ENTITY (ENTIT) and PERSON (PERSO) tables.

Imagem

Definition of the DISPATCH (DISPA) table in Genio.

Below, we show a view of the DISPATCH table showing the fields DISPADT (Dispatch date), DISPANR (Dispatch number), ISPREPAR (Is prepared), as well as the relationship with the Entity(ENTIT) table and the Person(PERSO) table, which will be used in the query that establishes the business criteria. Imagem

Definition of the PERSON (PERSO) table in Genio.

The EMAIL field in this view of the PERSON(PERSO) table, will be used in the definition of Person recipient of notification. Imagem

Definition of the ENTITY (ENTIT) table in Genio.

The EMAIL field in this view of the ENTITY(ENTIT) table, will be used in the definition of Entity recipient of notification. Imagem

Step 1

Mount the Query with the business criteria to send messages.

SELECT
[CODDISPA],
[DISPADT],
[DISPANR],
[CODENTIT],
[PREPARED],
T1.[CODPERSO],
T2.[NAME]
FROM [NFODISPATCH] T1
INNER JOIN [NFOPERSON] T2 ON T1.[CODPERSO]=T2.[CODPERSO]
WHERE [ISPREPAR]=1
--only send email if it hasn't been sent before
AND ([DISPANR] not in (SELECT[DOCUM_NR] FROM [NFONOTIF] WHERE [MAILSENT] = 1))

Imagem

Step 2

Define the dispatchalert query in Genio with the business criteria Query implementation and the Query columns.Imagem

Step 3

Create the recipients Entity and Person by choosing the email field to use as the Message destination.

Imagem

Step 4

Set Notification

In the field Notification query in the zone Query for creating notification choose the notification DISPATCHALERT and check Allow email submission and Allow writing of the notification fields.

Set notification message recipients

Imagem

Set tags to compose the message

Imagem

Step 5

Pressing in the Reserved fields button the user will see a popup list with the reserved fields necessary to notification management if we want a persistent support of Notifications.

Imagem

Choose the table where the fields reserved for the management of persistent notification data will be created if they do not exist in the selected table (NOTIF). To create these fields, press the Map table button.

After press of Map table button we will see that.

Imagem

In addition to the reserved fields, other mappings of query fields with table fields can be placed in the selected table. For this, new fields are inserted in the list Field mapping to the notification table as shown below.

Imagem

Imagem

Imagem

This new mapped field, in this case, will be used to check whether the message has already been sent to the Recipients once (only send email if it hasn't been sent before).

select
[CODDISPA],
[DISPADT],
[DISPANR],
[CODENTIT],
[PREPARED],
T1.[CODPERSO],
T2.[NAME]
from [NFODISPATCH] T1
inner join [NFOPERSON] T2 on T1.[CODPERSO]=T2.[CODPERSO]
where [ISPREPAR]=1
--only send email if it hasn't been sent before
and ( [DISPANR]
not in (select [DOCUM_NR] from [NFONOTIF] where [MAILSENT] = 1))

Step 6

In the WebAdmin administration portal, in Email Server menu item, create and configure a new Email server for sending messages.

Imagem

In the WebAdmin administration portal, on the Email Server menu item, create Email signatures to use in configuring notifications.

Imagem

Imagem

In the WebAdmin administration portal, in the Notifications settings menu item, select the desired Notification and edit it.

Imagem

Step 7

You can then change or create new messages by selecting the Message settings tab.

Imagem

In the Message settings, configure the message to be sent to the recipient, defining the e-mail server to be used and the message to be sent. In the composition of the message, you can use information from previously defined tags.

Imagem

In the tab DB messages you can see the messages sent and the success of sending them.

Imagem

As the persistent support for this notification was defined in Genio as the NOTIF table, it can be used in the application as a normal table and do business on top of it.

Imagem

Below is an example of the use of the NOTIF table in the Warehouse Management System application generated by Genio.

Imagem

Imagem

In the WebAdmin administration portal, in the Notifications settings, you can trigger the launch of notifications in manual mode by selecting the Run all button, which launches all notifications at once or by selecting the send icon of the desired notification.

Imagem

Step 8

QUIDSERVER

Previously it was said how to trigger notifications manually, but this operation is normally not the desired one. What is intended is that notifications are triggered in a scheduling process and with the necessary frequency for each notification. For this purpose we use the Quidgest's Quidserver scheduling service installed on a server.

Imagem

Imagem

Imagem

Below is an example of a NOTIF_1_DISPATCHALERT notification scheduling configuration.

More notifications can be added to this schedule. To do this, just create another key NOTIFICATIONID with the value of the desired notification identifier.

Imagem

Parameters

Key Value Note
URL http://localhost:5658/WebApi.asmx WebAdmin WebAPI Web Service (1)
USERNAME UQBVAEkARABHAEUAUwBUAA== Login of in Configuracoes.xml (2)
PASSWORD WgBQAEgAMgBMAEEAQgA= Password of in Configuracoes.xml (2)
YEARAPP 0
LANGUAGE ENUS EN_US (Optional)
FUNCTION NOTIFICATIONS
NOTIFICATIONID NOTIF_1_DISPATCHALERT Notification Identifier

(1) When calling the URL, it should return content similar to the one presented below.
Imagem

(2) Information to be retrieved from the configuracoes.xml file created by the WebAdmin when configuring the system in System Configuration item menu. See the example below where a partial content of the configuracoes.xml file is presented and where the Login and Password location can be seen.

    (...)

    <DataSystems>
        <DataSystem Name="0">
        <Type>SQLSERVER2008</Type>
        <Server>adara</Server>
        <Port />
        <Login>UQBVAEkARABHAEUAUwBUAA==</Login>
        <Password>WgBQAEgAMgBMAEEAQgA=</Password>
        <Data Id="NFO" Schema="NFO0" ConnEncrypt="false" ConnWithDomainUser="false" />
        <DataSystemLog />
    </DataSystem>

    (...)

Examples of Functions that can be used in Task Scheduler parameterization

Function name Parameter name Parameter type
NOTIFICATIONS NOTIFICATIONID string
TRANSFERLOGS YEARAPP string
REINDEX SCRIPTS string
REINDEX ZEROTRUE string
REINDEX YEARAPP string
REINDEX PASSWORD string
REINDEX USERNAME string