Online documentation - Websydian v6.0

Users Guide | Patterns Reference | WebsydianExpress | Search

 

Implementing Repeated Event Detection


Inheriting from the RepeatedEventDetection Pattern

First, you must create a local EventDetection entity in your application model that inherits from the RepeatedEventDetection pattern in the WSYSESS library. As the RepeatedEventDetection pattern makes use of the Session Control pattern it is also necessary to replace the abstract Websydian Session Control pattern with the session control pattern implemented in the application.

MyEventDetection is a ENT RepeatedEventDetection
  Replaces ENT
...by ENT
SessionControl
MySessionControl

The local MyEventDetection entity will now scope the pattern to implement Repeated Event Detection for the application.

Please refer to Implementing the SessionControl Pattern for details on how to implement the Session Control pattern.

Inherit from RelationalTable

As the DetectedEvents entity used to store detected events only inherits from STORAGE/DataAccess, you need to declare the DetectedEvents entity as a STORAGE/RelationalTable before the entity can be generated and built.

MyEventDetection.Data.DetectedEvents is a ENT STORAGE/RelationalTable

Using the Abstract Patterns

In order to declare a specific EventHandler function as a protected event, i.e. it is only allowed to be activated one time for each page instance, you must inherit from the abstract EventHandler function scoped under the Abstract entity. Each PageGenerator function that scopes a protected EventHandler function must inherit from the abstract PageGenerator function located the same place.

Example:

Order.ConfirmPage is a FNC MyEventDetection.Abstract.PageGenerator
Order.ConfirmPage.Order is a FNC MyEventDetection.Abstract.EventHandler

No further actions are needed to declare an EventHandler function for protected. All that is left is to generate and build the changed/created functions and built a new document template for the PageGenerator function.

When using protected events it is important to ensure that the user can continue with the application without being forced to use the back button when the user is presented for the error page. E.g. by using a frame menu or inserting a Continue button on the error page.