Causing a Class Event

Use the causeClassEvent method of the Class class to cause a class event. All objects subscribed to the specified event on instances of this class will be notified.

The parameters for the causeClassEvent method are listed in the following table.

Parameter Description
eventType An integer value selected by the user, in the range 16 through User_Max_Event.
immediate Value to indicate when the event is actioned. If this value is false, the notification occurs at the end of the transaction. If the client is not within a begin/commit transaction cycle, the notification waits for the next commit on that client. (If the value is true, the notification occurs immediately.)
userInfo

Value of type Any that is passed to the userNotify or userNotification event handler when the notification is received.

Notifications containing binary and string (Binary, String, StringUtf8) data of up to 48K bytes can be sent across the network. For applications running within the server node, the limit for notifications containing binary or string data is 2G bytes. Note, however, that this applies only to single user and server applications. In multiuser applications, persistent notifications are sent via the database server, even if the receiving process is on the same node as the sender. In notification cause events, exception 1267 (Notification info object too big) is raised if the binary or string userInfo data exceeds the applicable value.

The following example shows the use of the causeClassEvent method, where a notification is sent immediately.

userButton_click(btn: Button input) updating;
begin
    Customer.causeClassEvent(Refresh_Customer_Views, true, name);
end;

For more details about the causeClassEvent method, see "causeClassEvent" under "Class Class", in Chapter 1 of the JADE Encyclopaedia of Classes.