| ColdFusion 9.0 Resources | CFEventSee alsogetGatewayID, CFML CFEvent structure, CFEvent class in the Developing ColdFusion Applications Parameters
 UsageThis 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. ExampleThe 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(); 
} |