Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.0

Callback Points and Functions

Overview

The callback functionality provided by WebsydianExpress offers the option to add your own functionality to existing processes. The existing processes can either have been delivered as part of the WebsydianExpress runtime or they can have been delivered by a third party business process developer. The functions providing the extra functionality will most often be developed by yourself.

The places, where you can add your own functionality is called callback points. For each callback point, you can specify a list of functions that must be called. These functions are called callback functions.

The WebsydianExpress runtime offers a number of callback points. You can find the definitions for the system callback points using the administration interface (Site Configuration→Callback Functions).

In addition to these, third party developers - or for that matter your own developers - can implement their own callback points. To use these callback points you must first define the points in the system using the administration interface.

Callback Points and Sites

Callback points can be defined as either local or global. For local callback points, you specify the callback functions you want to call for a specific callback point for each site. For global callback points the callback functions you specify for the callback point will be no matter which site is being used.

You can define your own callback points as being global if you only want to specify the functions to call once instead of for each site.

If the functions to call be should be different from site to site, you must define your callback point as being local.

Most of the callback points provided by WebsydianExpress are local to provide the greatest flexibility. However, a couple of the callback points are called in situations where the site is not yet known - these callback points are defined as global.

Usage

To give an idea of what the callback functionality can be used for, a couple of examples are outlined here.

Use a system callback point to change the roles assigned after login

In some cases you have your own additional rules for assigning roles after a user has logged in. The WebsydianExpress runtime provides a callback point UserAfterLogin that is called just after the user has made a successful login and the session has been updated with the information from the user - but before the site has been loaded.

One example of how you could use this is if you have some information you want to show exactly once to each user. Using this callback point offers the option to add a role to the session that ensures that the information is shown (unless the user already has been shown this information).

Use a system callback point to change a user created in the administration interface

In some installations, you want to assign a specific role to all users. The WebsydianExpress runtime provides the callback point UserAfterCreate. This means you can call an API function that adds the role to the users after they have been created - thus speeding up the process of creating users.

Provide a callback point in your own business process

In addition to using the callback points provided by the WebsydianExpress runtime, you can also define your own callback points. This will most often be relevant if you are creating business processes that is to be deployed on multiple installations.

As an example, imagine the case where you want to create a business process where users can register that they want to receive a newsletter - and you want to deploy this business process at several customer sites.

To do this, you would create the business process, including the EventHandler function that handles the request for receiving the newsletter. In this function you would most likely register the user's request in a database and show a page to the user stating that he will receive the newsletter.

However, some of your customers might want to immediately send some kind of reply to the registered mail address for the user. Other customers might want to create a record in an existing system that handles the mailing of the newsletters. Still other customers might not want to do anything in this case.

To make it possible for each customer to customize the actions taken after the request has been processed, you can add a callback point to the EventHandler function. Each Customer can then create their own callback functions for this callback point - and thereby customize the actions that will be taken when this point is reached.

System Callback Points

As mentioned above, the WebsydianExpress runtime provides a number of callback points where you can introduce your own functionality into the existing functionality. This section provides an overview over the callback points.

All of these callback points are already defined in the WebsydianExpress database and you can assign callback functions to each point using the administration interface.

Webserver Callback Points

Server Callback Points

Administration interface

By using the WebsydianExpress Administration interface, you can define your own callback points and assign callback functions to the callback points.