Re: empty fields in SCXML events.

Why don't we just demand that it's boolean value has to evaluate to false whatever the type? We do not have any numbers so I don't see a problem.
  Stefan

On Apr 5, 2013, at 7:04 PM, Jim Barnett <Jim.Barnett@genesyslab.com<mailto:Jim.Barnett@genesyslab.com>> wrote:

We have to allow for event.data being a string, since our rules for interpreting event content say that if the content isn’t kvps, json or XML, it should be interpreted as a string.  So what should we say about the type of _event.data?  Should we introduce an object to hold the string value in cases where it has one?  Do we say that it can be an Object or a string?

-          Jim

From: Stefan Radomski [mailto:radomski@tk.informatik.tu-darmstadt.de<http://tk.informatik.tu-darmstadt.de>]
Sent: Friday, April 05, 2013 12:57 PM
To: David Junger
Cc: Voice Public List
Subject: Re: empty fields in SCXML events.

I'd like to add that _event.data might also be a string:

./test179.scxml:  <transition event="event1" cond="_event.data === '123'" target="pass"/>
./test294.scxml:   <transition event="done.state.s1" cond="_event.data === 'foo'" target="pass">
./test527.scxml:   <transition event="done.state.s0" cond="_event.data === 'foo'" target="pass">
./test529.scxml:   <transition event="done.state.s0" cond="_event.data === '21'" target="pass">
./test562.scxml:  <transition event="foo" cond="_event.data == 'this is a string'" target="pass"/>

Best regards
  Stefan

On Apr 5, 2013, at 5:53 PM, David Junger <tffy@free.fr<mailto:tffy@free.fr>> wrote:


Le 5 apr 2013 à 16:46, Jim Barnett a écrit :


The spec defines a set of standard fields in events, such as sendid, etc., and then defines conditions under which they should be left ‘emtpy’.  In the ECMAScript data model, we say that “name,type, sendid, origin, origintype, and invokeid are String values, while data is an Object value.”   So what should their values be when they are left ‘empty’?

String -> "", obviously
Object -> null or {}

The question for Object is what you want to get if you evaluate it as a condition. null is a falsy value, while {} converts to true. But {} is more of an "empty object" than null so I like it better.

David

Received on Friday, 5 April 2013 17:16:49 UTC