Using notification function in Exact Globe Next entity services
The entity services allow users to create and manipulate the data record(s) of Exact Globe Next via a third party application. This technology enables the software developers to connect systems with less programming and thus, simplifying the integration of multiple systems, which reduces the repetitive data entry and updating process.
The entity services allow a third party application to retrieve and manipulate data in Exact Globe Next and update the data in the third party application if changes were made to the Exact Globe Next data using the notification solution.
The objective of notification solution is to react to the changes in the entity component of Exact Globe Next, which is identified as "publisher", and publishes the changes as a notification to the third party application, which are identified as "subscriber". For example, with the notification solution, when an item is created in Exact Globe Next, a notification will be sent to the subscriber to create the item in the third party application automatically. This ensures the data in the third party application is updated instantly and synchronized with the data of Exact Globe Next for the business entities that are enabled for entity services.
The following actions are required to enable the notification solution:
- Activate the notification service.
- Develop a program, which is identified as the "provider", that will process the data received from the publisher meant for the subcriber.
- Subscribe to the notification service.
In summary, the "publisher" publishes the changes as a notification. The notification is received by the "provider" which processes the notification for the "subscriber".
To activate a notification service
In order to activate the notification service, it can be configured via a configuration file, with the file name “Exact.Notification.config” in the "xmd" subdirectory of the Exact Globe Next installation directory. The configuration file has two sections; publishers and subscribers. The notification component is dependent on the configuration file to get the available subscriptions to entity and also update subscribers based on available subscribers in the list.
"Publisher" is the one who publishes available topics including topic events. In the connectivity solution, entity component is used as a "publisher".
Topic Events: Create, Update, Delete.
This means that creating, updating, and deleting events on topic Account will trigger a notification to "subscribers" (only if there is a "subscriber" for this topic) through notification component.
The following is the example of the XML format of the publisher in the configuration file for topics Account, Item, and Resource.
The publisher can be configured based on the requirements. If you would like to add a new topic to be published, you can configure it by adding the xml tag under <Publishers>. Assuming that you would like to publish two new topics: Document and Request, with the topic events create, update, and delete, here is the example:
Note: By default, the topics Account, Item, Resource, Document, Request, and Project with topic events Create, Update, and Delete are published.
To Create a provider program for the subscriber
A "provider" is a program that you develop to process the notification received from the "publisher" for the "subscriber". You may instruct the program to update the data, send an e-mail or SMS, or perform other actions as required.
To create a provider, create a class that inherits from BSubscriber base class (Exact.Services.NotificationModel.BSubscriber). Implementation to show the notification can be carried out in the base method called Function Action(ByVal Message As String, ByRef ErrorMessage As String) As Boolean from the base class. The notification is passed via the Message parameter. If an error is encountered, it can be captured via the ErrorMessage parameter. The notification consists of the data changed based on the topic events and the topic in an xml format.
The following is an example of a simple provider (Text class) that writes the notification received into a text file and stores it into a physical file in the hard disk. The method will return "False" if an error is encountered. The derived class can be residing in any assembly as long as it is configured in the configuration file by providing the fully qualified class name and the assembly as shown in the following section.
Subscribe to a Notification service
The "subscriber" is required to subscribe to the notification services in order to process the notification that is published by the publisher.
"Subscriber" is the one who is interested in the published topic events. The subscriber section of “Exact.Notification.config” is used to configure the topic and topic events that are subscribed by subscribers. It will be using the provider model where each topic can be subscribed by multiple subscribers. It is configured based on subscriptions. The same topic can be subscribed by more than one subscriber.
Topic Events: Create, Update, Delete (Topic events here should be a subset of topic events available from the publisher).
Provider: Exact.Services.NotificationModel.Subscribers.Text, where the notification will be received by Text.
This means when there are create, update, or delete events happening in topic Account, it will receive a notification from the publisher through the notification component.
The following displays the xml format of the "subscribers" in the configuration file for Account, Item, and Resource. Three of them are using Text as the provider.
The subscriber can be configured based on the subscriptions. If you want to subscribe to a new topic, you can configure it by adding the xml tag under <Subscribers>. Assuming we would like to subscribe to two new topics: Document and Request, with the topic events create, update and delete, using the provider “Exact.Services.NotificationModel.Subscribers.MSMQ”, here is the example:
| Main Category:
|Attachments & notes
| Document Type:
|Online help main
| Security level:
|All - 0
| Sub category:
| Document ID: