Re: External communication with SCXML

Hey David,

On Feb 11, 2013, at 7:34 PM, David Junger <tffy@free.fr> wrote:

> In my implementation (github.com/Touffy/JSSCxml), which runs in Web browsers, it is not possible to fully implement basichttp so I didn't, and instead I added the <fetch> element (inspired from CCXML) which does what you describe (generates a callback event with the HTTP response), basically it's an SCXML interface to XHR. I haven't implemented namespaced executable content yet so it's not namespaced as it should be.
> Have a look at the documentation (http://touffy.hd.free.fr/~touffy/jsscxml/fetch.html) and tell me what you think.
> I have already used it in one project and it's quite handy, actually it's easier than writing typical XHR code in JavaScript.

I implemented fetch as a custom executable content, but there are some questions:

- What does it mean for the type to be "url"?
- How do you represent xml data in the event that is being delivered to the interpreter? The relevant part in the draft is at [1]:

"data. This field contains whatever data the sending entity chose to include in this event. The receiving SCXML Processor should reformat this data to match its data model, but must not otherwise modify it. If the conversion is not possible, the Processor must leave the field blank and must place an error 'error.execution' in the internal event queue."

As you are using the ECMAScript datamodel, I was wondering, whether you attempt to transform the XML into JSON (no bijective projection) or how you expose the XML in the event.

Best regards
Stefan

[1] http://www.w3.org/TR/scxml/#InternalStructureofEvents

Received on Tuesday, 12 February 2013 17:54:45 UTC