In the last months I’ve been working on a 3G video portal based on JSLEE (a java event driven application server) and Spring WebFlow 1.0.5 (a flow execution engine that allows to design a web app as a state machine).
The Video Portal uses SIP to established incoming calls and after the call is setup a Flow execution session is started to keep track of the state of the user inside the container. The user can interact with the video portal from a UMTS phone using DTMF tones sent to the application server as SIP INFO messages or inside the media path.
The JSLEE container provides a well define concurrency model using the concept of activity, all the event belonging to a given call are queued inside a so called activity context and are received by the application logic instantiated by the container to handle the call and registered to receive all the events inside the call.
Once the call is setup the application logic inside JSLEE (implementing using Service Building Blocks) ask the WebFlow Registry for a flow definition using a flow id and creates a flow execcution session and start the flow execution. After the flow is created all the events belonging to the call (like DTMF) are notified to the flow execution. The Flow Session is saved inside a persistent field that allows to continue the flow execution on a different node in case of failure of the first active node.
The call events are passed to the flow using a method of FlowExecutionImpl with the following signature:
Application signalEvent(String eventId, ExternalContext ctx)
the flow engine execute the transition described inside the flow definition for the given event, returns a view to be presented to the user and waits for the next event. The view usually is the url of the new video to be streamed to the user mobile phone using a Media Server.
A flow definition in spring webflow is represented using an XML files that defines the state machine implementing the video portal flow. The Flow Definition is very closed to the specification of the video portal application coming from the marketing, this reduces drammatically the implementation of the video application and provides a very fast and clean way to change the video portal behaviour according to the marketing needs.
Nasir Khan said
Interesting read.
So is the Flow definition conceptually similar to VXML/CCXML? What are the differences?
How dynamic can a flow be, based upon user input, external DB etc?
framtech said
The video portal application on the signalling plain is very simple (the application just sets up the call) so I was not going to use the support given by CCXML for call and signalling control. VXML has far as I know is well suited for voice application but extension for video are usually proprietary. My opinion about this standard is that is very specialized and reduces the developer ability to do something really innovative inside the application, what do you think ?
Webflow was mainly used to implement the video portal interaction with the user through DTMF tones and to integrate with the backend, infact the main requirements for the application were flexibility in term of back-end integration and user interaction.
Webflow addresses these requirements by defining three types of state:
1) ViewState is a state where the flow waits for input of the user (or an application) and returns a view to the container. Usually a URL pointing to a video file or a SMIL presentation.
2) ActionState where you can invoke operation of Spring components (initialized java classes provided by Spring framework). This action can call backend operation (DB queries, REST servlets or application logic) providing a great deal of reusability.
ActionState can be used for input validation when you enter a state or for executing application logic in the middle of a transition.
3) Subflows are used inside a flow to allow flow composition, this simplifies the overall flow structure.
I hope this answer your good questions. Thanks for the nice comment !
Alexandre Verri said
Very interesting application! Using two well know technologies you wrote a new innovative one. Congratulations for the job.
Btw, is the portal URL available now?
framtech said
The Video Portal is for UMTS video phones and is accessible on the mobile network by placing a video call to a short number reserved for VAS services.