On Sat, Sep 4, 2010 at 1:19 PM, Azraiyl <[email protected]> wrote: > Thanks for your response. Just out of curiousity: Is this the intended > behaviour of SCXML? > > Chapter 3.3.3: If the "event" clause is missing, the transition is > taken whenever the "cond" evaluates to true. > <snip/>
At a high level, the only way for the environment to communicate with a state machine is through events. Data model changes are best made via native mechanisms described in state machine theory (such as event payloads). Doing so will cause the "cond" to be evaluated in the process and has the additional benefit of being more declarative (i.e. it will be modeled with the rest of the state machine, rather than behavior that can't be noticed just by reading the SCXML document). Programmatic access to the data model (only root context is accessible) is provided as this is often convenient in certain environments. However, such access clearly isn't portable across implementations and has the downsides of not being tied into the event processing loop. If such a choice is made by the developer, there is an additional onus on the developer -- this includes, firing an event if need be and synchronizing access if needed etc. IMO, the section 3.3.3 quote probably needs some sort of disclaimer for programmatic access. There are cases where the application may deem it unnecessary for every programmatic update to the root context to result in evaluating all conds. Commons SCXML provides the developer that level of control. -Rahul --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
