commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cedric NICOLAS" <cedric.nico...@villefluide.fr>
Subject Managing content in an SCXML file
Date Tue, 03 Nov 2009 22:23:01 GMT
Dear Rahul and others,

I want to do a quite simple thing : having a state machine on a server
controlling user interface of mobile clients. 
The state machine would have a lot of states and complex stream, and for
some specific states it will embedded a simple markup language content (e.g.
an html subset) that will be delivered to the mobile client which when it
receives it, interpret and display it.

For example the server state machine would have "connect" state that will be
triggered when the mobile is establishing a connection, and would react by
giving to the mobile client the content to be displayed. An simple example
would be :

<state id="connect">
	<content>
		<title> Welcome ! </title>
		<button> text="Click here to continue" action ="send_OK"
</button>
		<button> text="Quit" action ="send_Quit" </button>
</content>
	<transition event="send_OK" target="next_state"/>
	<transition event="send_Quit" target="final_state"/>
</state>

In that case the content in <content> tags will be retrieved by the Java
code on void connect() method, and sent to the device. Server will listen to
device and when receiving a message like send_OK, trigger this to the state
machine.

To summarize I want to emulate a tiny web server hosting some tiny pages
with a state machine.

I've gone through all the documentation of Commons Scxml, and didn't find an
easy way to do this. The possible ways I see are to use a data model, but
using <assign> tags for setting my content seems to be quite heavy to write
and don't know how to assign an XML tree to a data model node, and other
possibility would be to use maybe custom actions, but how to describe in a
simple way my XML like-content ?

Do you have a suggestion to do this in an easy and readable way ?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message