[ 
https://issues.apache.org/jira/browse/SCXML-177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839752#comment-13839752
 ] 

Woonsan Ko commented on SCXML-177:
----------------------------------

Added 'strict' option and 'silent' option into SCXMLReader.Configuration:
- In strict mode, SCXMLReader throws a ModelException on any invalid/unknown 
elements in the context;
  in the default non-strict (lenient) mode, it doesn't throw a ModelException.
- In silent mode, SCXMLReader doesn't leave any warning logs on any 
invalid/unknown elements in the context;
  in the default non-silent (verbose) mode, it leave warning logs.

So example code can be like the following:

        configuration = new Configuration(...);
        configuration.setStrict(false);
        configuration.setSilent(true);
        scxml = SCXMLReader.read(scxmlRes, configuration);

- configuration.setStrict(true) turns on the strict mode; 
configuration.setStrict(false) turns off the strict mode (meaning enabling the 
default lenient mode).
- configuration.setSilent(true) turns on the silent mode; 
configuration.setSilent(false) turns off the silent mode (meaning enabling the 
default verbose mode).

Just for information, reader operations in SCXMLReader are all static members, 
so I put the strict and silent options in SCXMLReader.Configuration.
Also, I think our strict/lenient and silent/verbose options (simple model 
elements checking) should be much simpler than those in JEXL (more 
sophisticated handling for null, conditionals, etc.). So, I tried to keep it as 
simple as possible.

> Correct error/warning messages in SCXML reading to be up-to-date
> ----------------------------------------------------------------
>
>                 Key: SCXML-177
>                 URL: https://issues.apache.org/jira/browse/SCXML-177
>             Project: Commons SCXML
>          Issue Type: Bug
>            Reporter: Woonsan Ko
>            Assignee: Woonsan Ko
>            Priority: Trivial
>             Fix For: 2.0
>
>
> Some error/warning logs are outdated against the newest spec.
> For example,
> org.apache.commons.scxml2.model.ModelException: No SCXML child state with ID 
> "null" found; illegal initialstate for SCXML document
>       at 
> org.apache.commons.scxml2.io.ModelUpdater.logAndThrowModelError(ModelUpdater.java:297)
> It should inform of 'initial', not 'initialstate' and check if it is not set.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to