Configuring Event Notification
Order notifications are mostly sent from order flow. The only exception is order creation. It is the entry point of the order flow, thus, no order flow transition occurs yet and the notification can only be attached to the Order Placed event.
To configure a notification for the event:
- Open System > Settings > Events. The list of system events appears on the screen. The list of available event types appears on the screen.
- Select the Order Placed event type by clicking on the respective link in the Event Type column. Selected event type properties appear on the screen.
- Switch to the Event Handlers tab.
-
Click Add New Event Handler. The adding new event handler dialog window is displayed. Fill out the form:
- Type the name of programmatic object to be created into the Object field. For notifications it is MESSAGE.
- Type the name of object's method to be called when the event occurs into the Method field. For order notification it is DocumentNotification.
-
Type the method signature into the Signature field. It should contain the following row (replace TemplateName with the appropriate order notification template name without quotation marks): integer DocID, string TemplateName=Order Placed.
Note: This field is case-sensitive.
- Select the Stellart protocol from the Protocol list.
- Type the number of attempts the handler will make in case there is an error to occur into the Max Attempts field. For messaging it is normally "1".
- Type how frequently (in seconds) the retry attempts should be made into the Repeat Interval field. As notifications normally do not use retries, this setting is not important and can be "1".
- The Synchronous parameter indicates how the handler should be executed – synchronous or asynchronous. To prevent unnecessary delays in event processing, notifications should be sent asynchronously (the parameter should be clear).
- The Delay (hours) option sets by how many hours the handler execution should be delayed. There is no need to have any delays, so you can leave the option blank.
- The Priority parameter defines the events processing order. "1" is the highest priority. All tasks of the event receive the same priority. When there two or more events having the same priority occur, the newest tasks are processed first (not those that occurred first!).
- Click Save to finish configuring event notification.