W3C home > Mailing lists > Public > www-voice@w3.org > January to March 2013

Re: Unique ids for transitions

From: David Junger <tffy@free.fr>
Date: Fri, 1 Feb 2013 10:02:26 +0100
Message-Id: <55CF0351-F40B-4C13-A3C3-74672943F19F@free.fr>
To: "VBWG Public (www-voice@w3.org)" <www-voice@w3.org>
Le 1 feb 2013 à 00:40, Gavin Kistner a écrit :

> Transitions currently do not specify the presence of an id="..." attribute. As any pair of states can have n transitions anchored at both ends, even with the same event(s), the only way to uniquely talk about a particular transition (to any sort of an external system) is to fully describe it. Contrast this with a state, which can be uniquely identified with a short id string.
> 
> This causes no problem for the runtime itself. However, for external tools working with an SCXML document this can be annoying. I'm thinking specifically of a visual runtime debugger for a state machine. For example, consider the scxmlgui tool[1]. It has a simple network protocol for highlighting/unhighlighting either states or transitions. The states are referred to by id. The transitions are referred to by source/target state ids, which clearly does not uniquely reference a specific transition in all cases.
> 
> It will be trivial to add a namespaced attribute to transitions to track this, but I would feel cleaner if this were in the spec itself. Any chance of having an a non-required id (ID) attribute spec'd on <transition> elements?

There are two ways to reliably reference a transition without an identifier:
- by state id and event+cond, which should be unique within a state
- by using the document structure (basically, using an XPath, CSS selector, or wrapping one of those for convenience)
Using the target of a transition to identify it is insufficient without the above and unnecessary with them, as only the first transition with the same event+cond can ever be enabled.

However, it is true that these methods of reference are not identifiers and I understand that you may wish for one, especially in an editor.

I am opposed to adding the "id" attribute to anything that is not a state. In fact, it is annoying enough that <send> and <data> elements have it. A namespaced attribute (with the right namespace) is actually the clean way to do it, since it is clearly meta-data and, as you said, irrelevant to core SCXML. Besides, making that attribute part of SCXML would mean that authors of SCXML documents would feel compelled to waste time thinking of a name for all their transitions no matter the tools they use to create it. It is better that an IDE add automatically-generated, namespaced identifiers for its internal use if it does need them.

			David
Received on Friday, 1 February 2013 09:02:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 1 February 2013 09:02:58 GMT