IDL for SCXML interpreters

Hey there,

this is a suggestion for an upcoming version of the standard or maybe a note related to SCXML:

in order to further harmonize implementations of SCXML, I’d like to propose that we work on a minimal interface description language (IDL) for SCXML interpreters, not unlike those found for the W3C DOM[1] and other documents popular with the web environment. To get us started, I had a look at [1] and came up with the IDL below.

It’s obviously very limited and raw, but it would provide an obvious interface for application developers to easily change conforming implementations. Could anyone who maintains an implementation imagine to provide such an interface, or do you feel that it’s a futile attempt and not needed at all?

Currently the IDL will just specify:
1. where to get interpreters and initialize interpreters (by URI, String or DOM node)
2. How to run them (while(interpreter.step(true) != FINISHED))
3. A very raw set of exceptions they might throw

There are several other things one could standardize as well, but I think, these are the most important aspects to make implementations somewhat swappable. We can, of course, try to harmonize other aspects as well. Thoughts anyone?

Regards
Stefan

P.S.: I checked that my MUA will not add newlines when sending, I hope for the sake of readability that yours does too.

module scxml {
valuetype SCXMLString sequence<unsigned short>;

exception SCXMLException {
unsigned short code;
SCXMLString cause;
};

const unsigned short SCXML_PARSE_ERR  = 1; // Given string could not be parsed as an xml document
const unsigned short SCXML_SCHEMA_ERR = 2; // XML DOM not a valid SCXML document
const unsigned short SCXML_IMPL_ERR   = 3; // Unknown datamodel, ioproc, executable content or invoker used

// central place to get interpreter instances
interface SCXMLImplementation {
Interpreter fromURI(in SCXMLString uri)       raises(SCXMLException);
Interpreter fromXML(in SCXMLString xmlString) raises(SCXMLException);
Interpreter fromDOM(in Node scxmlRoot);
}

interface Configuration {
SCXMLString item(in unsigned long index);
readonly attribute unsigned long length;
};

interface Interpreter {
const unsigned int AFTER_MICROSTEP = 1; // step finished with a single microstep
const unsigned int AFTER_MACROSTEP = 2; // step finished with a single macrostep and interpreter is stable
const unsigned int IDLE            = 3; // interpreter is stable with no pending events on queues
const unsigned int FINISHED        = 4; // interpreter reached top-level final state

const unsigned int step()                    raises(SCXMLException);
const unsigned int step(in boolean blocking) raises(SCXMLException);
void interpret()                             raises(SCXMLException);

const receive(in SCXMLEvent event);

readonly attribute Configuration configuration;
readonly attribute Configuration basicConfiguration;
}
}

Received on Friday, 27 June 2014 19:11:14 UTC