You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rahul Akolkar <ra...@gmail.com> on 2008/07/31 04:25:50 UTC

Re: [SCXML] actions and undefined attributes

On Wed, Jul 30, 2008 at 4:39 PM, Daniel Schwager
<Da...@dtnet.de> wrote:
> Hi Rahul,
>
> if you use attributes not defined in an customer actionclass (means,
> there are not
> getter/setter in the action-class for these attributes), SCXML will not
> fail.
>
> I think, using undefined attributes (=without getter/setter) should end
> with an failure. What do you think  ?
>
<snip/>

You mean parse failure? That wouldn't be in line with the functioning
of the rest of the library (same thing will happen with elements in
the SCXML namespace) and probably non-trivial to implement (we may
have to extend the underlying digester functionality in this regard).
More importantly, IMO, SCXML documents should be able to support
attributes in other namespaces on various elements for compound
document scenarios, and this adds further complexity.

I think the important question is why the undefined attributes are
getting added in the first place. IMO, a more appropriate take on this
might be to introduce better tooling on the authoring side and / or
introduce validation tools such as an augmented schema for SCXML +
your custom actions.

-Rahul


> regards
> Danny
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [SCXML] actions and undefined attributes

Posted by Rahul Akolkar <ra...@gmail.com>.
On Thu, Jul 31, 2008 at 2:27 AM, Daniel Schwager
<Da...@dtnet.de> wrote:
>> > I think, using undefined attributes (=without getter/setter) should
> end
>> > with an failure. What do you think  ?
>> >
>> <snip/>
>>
>> You mean parse failure? That wouldn't be in line with the functioning
>> of the rest of the library (same thing will happen with elements in
>> the SCXML namespace) and probably non-trivial to implement (we may
>> have to extend the underlying digester functionality in this regard).
>> More importantly, IMO, SCXML documents should be able to support
>> attributes in other namespaces on various elements for compound
>> document scenarios, and this adds further complexity.
>
> This is not an XML parsing topic, I agree with you.
>
> But using your errorreporter listener
>        scxmlExecutor.setErrorReporter(new SimpleErrorReporter())
> to report such a "problem" would be nice and easy ..
>
>>
>> I think the important question is why the undefined attributes are
>> getting added in the first place.
>
> e.g. typing errors or change of Actions without modifing the model....
>
>> IMO, a more appropriate take on this
>> might be to introduce better tooling on the authoring side and / or
>> introduce validation tools such as an augmented schema for SCXML +
>> your custom actions.
>
> Sure - but there is not such a tool and it's a lot of work to write one
> for checking consistence and semantic of stuff like
>        - states
>        - events
>        - action attributes
>        - ....
>
<snip/>

The library assumes well-formed, valid input, though we've been
steadily improving error reporting as we can. For example, the parser
will complain if you specify a transition target that does not exist,
or specify a transition target whose id clashes, it will warn when it
skips over elements it cannot recognize etc.

For issues like typos in custom actions attributes and the like, I
think creating a quick custom DTD / schema and using a decent (XML)
editor has good ROI :-) While it would be useful to have better
warnings and error reporting here as well, there are no immediate
plans to work on this.

Ofcourse, as always, if anyone else wants to make a proposal for such
improvements, and submit the appropriate well-tested patches in JIRA,
that'd be great too.

-Rahul


> Regards
> Danny
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


AW: [SCXML] actions and undefined attributes

Posted by Daniel Schwager <Da...@dtnet.de>.
> > I think, using undefined attributes (=without getter/setter) should
end
> > with an failure. What do you think  ?
> >
> <snip/>
> 
> You mean parse failure? That wouldn't be in line with the functioning
> of the rest of the library (same thing will happen with elements in
> the SCXML namespace) and probably non-trivial to implement (we may
> have to extend the underlying digester functionality in this regard).
> More importantly, IMO, SCXML documents should be able to support
> attributes in other namespaces on various elements for compound
> document scenarios, and this adds further complexity.

This is not an XML parsing topic, I agree with you.

But using your errorreporter listener 
	scxmlExecutor.setErrorReporter(new SimpleErrorReporter()) 
to report such a "problem" would be nice and easy ..

> 
> I think the important question is why the undefined attributes are
> getting added in the first place. 

e.g. typing errors or change of Actions without modifing the model....

> IMO, a more appropriate take on this
> might be to introduce better tooling on the authoring side and / or
> introduce validation tools such as an augmented schema for SCXML +
> your custom actions.

Sure - but there is not such a tool and it's a lot of work to write one
for checking consistence and semantic of stuff like
	- states
	- events
	- action attributes
	- ....

Regards
Danny

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org