Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Creating and Initializing Events | Creating Events
 
Creating Events
 
General Event Methods
Field Type Checking
Converting Events as Binary Data
Restoring Events from Binary Data
Before your client application can publish or deliver an event, it must create the event and set the event's fields. The example below contains an excerpt from a sample application that shows the creation of a new event. The constructor takes the following parameters:
*A BrokerClient reference.
*The name of the event type. In the following example, the event scope is "Sample" and the event type name is "SimpleEvent":
. . .
public static void main(String args[])
{
BrokerClient c;
BrokerEvent e;
 
/* Create a client */
. . .
/* Create the event */
try {
e = new BrokerEvent(c, "Sample::SimpleEvent");
} catch (BrokerException ex) {
System.out.println("Error on create event\n"+ex);
return;
}
. . .