serializing/deserializing

25 views
Skip to first unread message

Javier Abanses

unread,
Jul 24, 2012, 12:47:19 AM7/24/12
to scio...@googlegroups.com
Hi, is there any way to serialize the model ( as in the internal annotated model object ) back into json/xml automatically? If not, any pointers about what would be the best way to go about doing this?

Thanks in advance.

Javi

Jacob Beard

unread,
Jul 24, 2012, 1:02:21 AM7/24/12
to scio...@googlegroups.com
Hi Javi,

Right now, the following transformations are used to transform SCXML to the model:

SCXML -> JsonML -> Annotated JsonML -> Model

The model is basically just the Annotated JsonML, but with state and transition ids converted to js object references, and with action code converted to js functions. The Annotated JsonML is serializable as json, but the model is not, due to the fact that these js references and functions are not json-serializable. This is by design.

Furthermore, these transformations are abstracted by the current API, so for example, if you use scion.urlToModel, the transformations are treated as internal data structures, so that the JsonML and Annotated JsonML are not exposed to the caller.

If you can provide me with more information on what you're trying to do, I may be able to offer more guidance.

Thanks,

Jake

Javier Abanses

unread,
Aug 23, 2012, 11:35:39 AM8/23/12
to scio...@googlegroups.com, jbe...@cs.mcgill.ca
Hi Jake, apologies for the lateness of the reply, i must have missed the email notification.

I am in the middle of a contract but I will get back to you with a demo and some context when i am done.

Cheers

Javi

Jacob Beard

unread,
Aug 24, 2012, 6:19:02 PM8/24/12
to scio...@googlegroups.com
Hi Javier,

Feel free to ping me with questions any time.

Best,

Jake

On Thu, Aug 23, 2012 at 11:35 AM, Javier Abanses
Reply all
Reply to author
Forward
0 new messages