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
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.
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.
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.
DISPATCH(DISPA) table defined in Genio is accessed in the SQL server as being NFODISPATCH table.
Presentation of Relational Model where the DISPATCH (DISPA) table is related in an N:1 relationship with the ENTITY (ENTIT) and PERSON (PERSO) tables.
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.
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.
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.
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))
Define the dispatchalert query in Genio with the business criteria Query implementation and the Query columns.
Create the recipients Entity and Person by choosing the email field to use as the Message destination.
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.
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.
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.
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.
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))
In the WebAdmin administration portal, in Email Server menu item, create and configure a new Email server for sending messages.
In the WebAdmin administration portal, on the Email Server menu item, create Email signatures to use in configuring notifications.
In the WebAdmin administration portal, in the Notifications settings menu item, select the desired Notification and edit it.
You can then change or create new messages by selecting the Message settings tab.
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.
In the tab DB messages you can see the messages sent and the success of sending them.
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.
Below is an example of the use of the NOTIF table in the Warehouse Management System application generated by Genio.
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.
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.
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.
Parameters
Key | Value | Note |
---|---|---|
URL | http://localhost:5658/WebApi.asmx |
WebAdmin WebAPI Web Service (1) |
USERNAME | UQBVAEkARABHAEUAUwBUAA== | Login of |
PASSWORD | WgBQAEgAMgBMAEEAQgA= | Password of |
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.
(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>
(...)
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 |