The LiveCycle Data Services ES assembler lets you use ColdFusion components (CFCs) to provide the back-end data management for a Flex application that uses the Data Management Service. You can run LiveCycle Data Services ES as part of ColdFusion or remotely. If you are running LiveCycle Data Services ES as part of ColdFusion, LiveCycle Data Services ES and ColdFusion communicate directly. If you are running LiveCycle Data Services ES remotely, LiveCycle Data Services ES and ColdFusion communicate by using RMI. The following diagram shows how ColdFusion and LiveCycle Data Services ES interact in both cases:
Note: To use the LiveCycle Data Services ES assembler, the Flex application must be running on Flex Data Services 2.0.1 or LiveCycle Data Services 2.5, although not every feature is supported in Flex Data Services 2.0.1.
The Flex server includes a ColdFusion Data Service adapter. The adapter processes changes to data to ensure that data on the client is synchronized with back-end data and vice versa; it executes the sync, fill, count and get operations, identifies conflicts, and passes results to LiveCycle Data Services ES.
ColdFusion includes the LiveCycle Data Services ES assembler; along with the ActionScript translator, it converts the input arguments where necessary and translates the return values.
Note: If you install LiveCycle Data Services ES, ColdFusion does not map .SWF files. This means that all .SWF files are served through the ColdFusion web application instead of the web server.
The following diagram shows the process that LiveCycle Data Services ES and ColdFusion use when a Flex application calls a method in a ColdFusion component:
- A Flash client requests data that is handled by the LiveCycle Data Management Service adapter.
- Flex calls a fill, sync, get, or count method in the Data Service.
- The ColdFusion Data Service adapter sends the request to the LiveCycle Data Services ES assembler. If you are running LiveCycle Data Services ES remotely, the adapter sends the request by using Java Remote Method Invocation (Java RMI).
- The LiveCycle Data Services ES assembler and the ActionScript translator convert ActionScript 3.0 data types to the appropriate ColdFusion values.
- The ColdFusion server invokes the fill, sync, get, or count method of the assembler CFC, which invokes the appropriate methods in the DAO CFC.
- The ColdFusion application creates an array of Value Objects or appropriate return value, which it sends to the ColdFusion server.
- The ColdFusion server sends the results to the LiveCycle Data Services ES assembler.
- The LiveCycle Data Services ES assembler and the ActionScript translator convert ColdFusion values to the appropriate ActionScript 3.0 data types, and then the assembler sends the results to the ColdFusion Data Service adapter.
- The ColdFusion Data Service adapter sends the results to the LiveCycle Data Management Service.
- The LiveCycle Data Management Service passes the results to the Flash client.
Note: The RMI registry, which facilitates communication between the ColdFusion Data Service assembler and the remote LiveCycle Data Management Service uses port 1099, which is the default port for Java RMI. You can change the port number by adding -Dcoldfusion.rmiport=1234 to the Java JVM arguments on both the ColdFusion server and the Flex server.