CFEvent constructor.
Event Gateway Development
CFEvent(String gatewayID)
getGatewayID, CFML CFEvent structure, "CFEvent class" in the ColdFusion Developer's Guide
|
Parameter |
Description |
|---|---|
| gatewayID |
The ID of the gateway. This parameter indicates the source of the message and must be the value that is passed in the Gateway constructor or set using the Gateway setGatewayID method. The SMS gateway ID must be 21 characters or fewer. |
This method creates a container for an event gateway message that you send to ColdFusion gateway services in a gatewayServices.addEvent method for delivery to a CFC listener method.
The following example, based on code for the ColdFusion asynchronous CFML gateway, sends a message to that the gateway has received to a CFC:
public String outgoingMessage(coldfusion.eventgateway.CFEvent cfmsg)
{
// Get the data
Map data = cfmsg.getData();
boolean status = true;
if (data != null)
{
// create an event
CFEvent event = new coldfusion.eventgateway.CFEvent(gatewayID);
//set the event field values
event.setGatewayType("CFMLGateway");
event.setOriginatorID("CFMLGateway");
event.setData(data);
// send it to the event service
status = gatewayService.addEvent(event);
}
return new Boolean(status).ToString();
}