About Flex and ColdFusion



ColdFusion includes the Data Services Messaging event gateway, which uses the ColdFusion event Gateway Adapter to send messages to and receive messages from the LiveCycle Data Services ES. This means that ColdFusion applications and Flex applications can publish to and consume events from the same event queue.

Note: To use the Data Services Messaging event gateway to interact with a Flex application, the Flex application must be running on LiveCycle Data Services ES.

How ColdFusion and Flex interact

You can send messages from a ColdFusion application to a Flex application, through the Data Services Messaging event gateway. Conversely, you can send messages from a Flex application to a ColdFusion application.

Either the ColdFusion application or the Flex application can initiate sending a message.

  1. The Flex application generates a message.

  2. The Flex Message Service passes the message to the ColdFusion Event Gateway Adapter.

  3. The ColdFusion Event Gateway Adapter sends the message to the Data Services Messaging event gateway, by using Java Remote Method Invocation (Java RMI).

  4. The Data Services Messaging event gateway and the ActionScript translator convert ActionScript 3.0 data types to the appropriate ColdFusion values and add the message to the event gateway queue.y

  5. The ColdFusion server calls the onIncomingMessage method of the Data Services Messaging event gateway listener CFC.

  6. The ColdFusion application generates a message, which it sends to the ColdFusion server.

  7. The ColdFusion server sends the message to the Data Services Messaging event gateway.

  8. The Data Services Messaging event gateway and the ActionScript translator convert ColdFusion values to the appropriate ActionScript 3.0 data types and then the gateway sends the message to the ColdFusion Event Gateway Adapter.

  9. The ColdFusion Event Gateway Adapter sends the message to the Flex Message Service.

  10. The Flex Message Service passes the message to the Flex application.

Note: The RMI registry, which facilitates communication between the ColdFusion Event Gateway Adapter and the Data Services Messaging event gateway uses port 1099, which is the default port for Java RMI. You cannot change this port number. To ensure that the RMI registry provides registry service for both LiveCycle Data Services and ColdFusion, start LiveCycle Data Services first, and then start ColdFusion. If you stop Flex, restart LiveCycle Data Services, and then restart the gateway.

Application development and deployment process

The following is a typical process for developing and deploying a ColdFusion application that communicates with a Flex application through the Data Services Messaging event gateway:

  1. Design your application.

  2. Configure a Data Services Messaging event gateway instance.

  3. Write your ColdFusion CFCs, CFM pages, and any other application elements.

  4. Test your application using Flex Enterprise Services 2.

  5. Make the application publicly available.