Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | Creating and Initializing Events | Creating Events
 
Creating Events
 
General Event Functions
Field Type Checking
Before your client application can publish or deliver an event, it must create the event and set the event's fields. The following example contains an excerpt from the publish1.c sample application that shows the use of the awNewBrokerEvent function to create an event. The function takes the following parameters:
*A Broker client pointer.
*The name of the event type. In this example, the event scope is "Sample" and the event type name is "SimpleEvent."
*A BrokerEvent that, upon return, will reference the newly created event.
The following example illustrates how to create an event:
int main(int argc, char **argv)
{
Broker client c;
BrokerEvent e;
. . .
/* Create the event */
. . .
err = awNewBrokerEvent(c, "Sample::SimpleEvent", &e);
if (err != AW_NO_ERROR) {
printf("Error on create event\n%s\n", awErrorToString(err));
return 0;
}
. . .